Commit 0d767e59dba for woocommerce
commit 0d767e59dbabb268ce7540fe0d426dc9d80169ed
Author: Brian Coords <bacoords@gmail.com>
Date: Thu May 7 14:01:53 2026 -0700
Migrate REST API documentation to monorepo (#63630)
* initial move of rest API v3 docs to monorepo
* Convert REST API docs to Docusaurus MDX with multi-language tabs
Migrate 33 REST API documentation files from legacy markdown to MDX format:
- Rename files from _*.md to *.mdx
- Add front matter with sidebar_position and sidebar_label
- Add Tabs/TabItem imports from @theme
- Wrap consecutive code examples (cURL, JS, PHP, Python, Ruby) in tab components
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Reorder REST API docs: Introduction, Authentication, then Index
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Replace HTML endpoint blocks with http code blocks
Convert 140 verbose HTML endpoint divs to simple code blocks:
Before:
<div class="api-endpoint">
<div class="endpoint-data">
<i class="label label-post">POST</i>
<h6>/wp-json/wc/v3/coupons</h6>
</div>
</div>
After:
```http
POST /wp-json/wc/v3/coupons
```
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* update response example formatting
* Remove trailing hashes from markdown headings
Convert `## Heading ##` format to standard `## Heading` for all heading levels
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Reorder REST API docs to match original sidebar order
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Move introduction and authentication to rest-api root
- Move introduction.mdx and authentication.mdx out of resources-endpoints/
- Update README.md links to point to local docs instead of external URL
- Update image paths in authentication.mdx for new location
- Adjust sidebar positions in resources-endpoints/ (shift by -2)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Combine REST API intro docs and fix sidebar structure
- Merge README.md and introduction.mdx into index.mdx
- Add sidebar_position to apis/README.md (position 0)
- Add _category_.json for rest-api/ (position 1)
- Update resources-endpoints _category_.json (position 2)
- Replace HTML aside elements with Docusaurus admonitions
Sidebar order:
1. Getting Started (apis/README.md)
2. REST API (rest-api/)
- Introduction (index.mdx)
- Authentication
- Resources and Endpoints
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix broken links and anchors in REST API docs
- Fix apis/README.md link to rest-api/
- Fix cross-file links to use correct relative paths (../)
- Update anchor links to use triple hyphens for headings with " - "
(e.g., #coupon-meta-data-properties → #coupon---meta-data-properties)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Reorganize REST API docs with consistent version structure
- Rename resources-endpoints folder to v3 for consistent naming
- Move API reference page to main rest-api folder
- Remove redundant introduction/authentication/index pages from v1 and v2
- Convert HTML api-endpoint divs to code blocks in v1 and v2 docs
- Update sidebar positions: v3 (current), v2, v1
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Add index pages and convert JSON response blockquotes to headings
- Add index.mdx with DocCardList to v1, v2, and v3 directories
- Convert blockquote "> JSON response example:" to heading format
- Remove generated-index links from _category_.json files
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Convert HTML aside elements to Docusaurus admonitions
- Convert <aside class="notice"> to :::note
- Convert <aside class="warning"> to :::warning
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Convert HTML label elements to inline code with uppercase text
- Convert <i class="label label-info">text</i> to \`TEXT\`
- Applies to read-only, mandatory, and other label types
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Combine HTTP request and JSON response into unified tab panels
- Remove separate "### HTTP request" and "### JSON response example" headings
- Add JSON response as a new "JSON Response" tab within the existing Tabs component
- Creates a cleaner, more compact documentation structure
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix code examples and documentation issues from CodeRabbit review
Fixes syntax errors in code examples:
- PHP: Use '=>' instead of ':' for array key-value pairs
- Ruby: Add missing commas between hash keys
- Python/Ruby: Use '#' instead of '//' for comments
- JavaScript: Use 'post' instead of 'get' for create operations
- JSON: Fix invalid array-in-object syntax
Fixes URL and endpoint issues:
- Remove double slashes in curl example URLs
- Replace HTML-escaped placeholders with proper angle brackets
- Use 'coupons/batch' instead of 'customers/batch' in coupon examples
- Use plural 'webhooks' instead of singular 'webhook' in endpoint
Fixes response example inconsistencies:
- Align ID values in _links.self.href with resource id field
- Consistent batch delete ID in customers example
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix duplicate response tabs in v3/orders.mdx
Remove duplicate JSON Response tabs that were incorrectly placed
within the same Tabs component in:
- "Retrieve an order" section
- "List all orders" section
This fixes the Docusaurus build error: "Duplicate values 'response'
found in <Tabs>. Every value needs to be unique."
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix broken anchor links in REST API v1/v2 documentation
Docusaurus converts headings with " - " (space-hyphen-space) to
anchors with "---" (triple hyphen). Update anchor links to match:
- v2: Update all property reference links to use --- format
(e.g., #customer-billing-properties -> #customer---billing-properties)
- v1/orders.mdx: Add missing billing/shipping address property sections
and fix refunds link (#refunds-line-properties -> #refund-line-properties)
- v2/order-refunds.mdx: Fix taxes link to match heading format
(#order-refund---line-item-taxes-properties -> #order-refund-line-item---taxes-properties)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* move api-reference to v3
* fix internal docs references to rest api
* Fix documentation issues flagged by CodeRabbit
- Fix webhook header name X-WC-Delivery-ID → X-WC-Webhook-Delivery-ID
- Change request_headers and response_headers types from array to object
- Add missing X-WC-Webhook-Source header to request header properties
- Fix plural wording "webhooks" → "webhook" in v1/webhooks.mdx
- Fix date_created_gmt description (order → customer) in v2/customers.mdx
- Change force parameter type from string to boolean across multiple files
- Fix tax_class type from integer to string in v2/order-refunds.mdx
- Fix dp parameter type from string to integer in v2/order-refunds.mdx
- Fix menu_order value inconsistency (5 → 6) in v2/product-attribute-terms.mdx
- Align Ruby batch example names with other language tabs in v2/product-attributes.mdx
- Align enabled values (true → false) in v2/payment-gateways.mdx examples
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Fix markdown table alignment lint errors in Store API docs
Remove aligned table style markers to fix MD060 lint errors.
The table now uses unaligned style which doesn't require
consistent pipe positions across all rows.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* updates rest api settings images to modern ui and logo
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
diff --git a/docs/apis/README.md b/docs/apis/README.md
index d4c3eedb6c6..1b542cccd82 100644
--- a/docs/apis/README.md
+++ b/docs/apis/README.md
@@ -1,6 +1,7 @@
---
post_title: 'Getting Started with WooCommerce APIs'
sidebar_label: 'Getting started'
+sidebar_position: 0
---
# Getting Started with WooCommerce APIs
@@ -11,7 +12,7 @@ WooCommerce provides a number of programmatic APIs to interact with WooCommerce
The WC REST API is a powerful part of WooCommerce which lets you read and write various parts of WooCommerce data such as orders, products, coupons, customers, and shipping zones. It based on the [WordPress REST API](https://developer.wordpress.org/rest-api/).
-Explore the [WC REST API](./rest-api/README.md) documentation.
+Explore the [WC REST API](./rest-api/) documentation.
## Store API
diff --git a/docs/apis/rest-api/README.md b/docs/apis/rest-api/README.md
deleted file mode 100644
index e1bf3a07d63..00000000000
--- a/docs/apis/rest-api/README.md
+++ /dev/null
@@ -1,98 +0,0 @@
----
-post_title: Getting started with the WooCommerce REST API
-category_slug: rest-api
-sidebar_label: REST API
----
-
-# WooCommerce REST API
-
-The [REST API](https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction) is a powerful part of WooCommerce which lets you read and write various parts of WooCommerce data such as orders, products, coupons, customers, and shipping zones.
-
-## Requirements
-
-In order to access the REST API using the standard endpoint URI structure (e.g. `wc/v3/products`), you must have your WordPress permalinks configured to something other than "Plain". Go to **Settings > Permalinks** and choose an option.
-
-
-
-## API reference
-
-[WooCommerce REST API Docs](https://woocommerce.github.io/woocommerce-rest-api-docs/) provides technical details and code samples for each API endpoint.
-
-## Authentication
-
-Authentication is usually the part most developers get stuck on, so this guide will cover a quick way to test that your API is working on your server and you can authenticate.
-
-We'll use both [Postman](https://www.getpostman.com/) and [Insomnia](https://insomnia.rest/) clients in these examples. Both are free and will help you visualise what the API offers.
-
-Before proceeding, please read the [REST API docs on authentication which covers the important parts concerning API Keys and Auth](https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication). We're only covering connecting over HTTPS here since it's the simplest and most secure method. You should avoid HTTP if possible.
-
-## Generate keys
-
-To start using REST API, you first need to generate API keys.
-
-1. Go to *WooCommerce > Settings > Advanced*
-2. Go to the *REST API* tab and click *Add key*.
-3. Give the key a description for your own reference, choose a user with access to orders etc, and give the key *read/write* permissions.
-4. Click *Generate api key*.
-5. Your keys will be shown - do not close this tab yet, the secret will be hidden if you try to view the key again.
-
-
-
-## Make a basic request
-
-The request URL we'll test is `wp-json/wc/v3/orders`. On localhost the full URL may look something like this: `https://localhost:8888/wp-json/wc/v3/orders`. Modify this to use your own site URL.
-
-In Postman, you need to set the fields for request type, request URL, and the settings on the authorization tab. For Authorization, choose *basic auth* and enter your *consumer key* and *consumer secret* keys from WooCommerce into the username and password fields
-
-Once done, hit send and you'll see the JSON response from the API if all worked well. You should see something like this:
-
-
-
-Insomnia is almost identical to Postman; fill in the same fields and again use basic auth.
-
-
-
-That's it! The API is working.
-
-If you have problems connecting, you may need to disable SSL verification - see the connection issues section below.
-
-## Common connection issues
-
-### Connection issues with localhost and self-signed SSL certificates
-
-If you're having problems connecting to the REST API on your localhost and seeing errors like this:
-
-
-
-You need to disable SSL verification. In Postman you can find this in the settings:
-
-
-
-Insomnia also has this setting the preferences area:
-
-
-
-### 401 Unauthorized
-
-Your API keys or signature is wrong. Ensure that:
-
-- The user you generated API keys for actually has access to those resources.
-- The username when authenticating is your consumer key.
-- The password when authenticating is your consumer secret.
-- Make a new set of keys to be sure.
-
-If your server utilizes FastCGI, check that your [authorization headers are properly read](https://web.archive.org/web/20230330133128/https://support.metalocator.com/en/articles/1654091-wp-json-basic-auth-with-fastcgi).
-
-### Consumer key is missing
-
-Occasionally 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:
-
-```text
-https://local.wordpress.dev/wp-json/wc/v2/orders?consumer_key=XXXX&consumer_secret=XXXX
-```
-
-### Server does not support POST/DELETE/PUT
-
-Ideally, your server should be configured to accept these types of API request, but if not you can use the [`_method` property](https://developer.wordpress.org/rest-api/using-the-rest-api/global-parameters/#_method-or-x-http-method-override-header).
diff --git a/docs/apis/rest-api/_category_.json b/docs/apis/rest-api/_category_.json
new file mode 100644
index 00000000000..8503483f02f
--- /dev/null
+++ b/docs/apis/rest-api/_category_.json
@@ -0,0 +1,4 @@
+{
+ "label": "REST API",
+ "position": 1
+}
diff --git a/docs/apis/rest-api/authentication.mdx b/docs/apis/rest-api/authentication.mdx
new file mode 100644
index 00000000000..bee84d1d28b
--- /dev/null
+++ b/docs/apis/rest-api/authentication.mdx
@@ -0,0 +1,433 @@
+---
+sidebar_position: 1
+sidebar_label: 'Authentication'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Authentication
+
+WooCommerce includes two ways to authenticate with the WP REST API. It is also possible to authenticate using any [WP REST API authentication](http://v3.wp-api.org/guide/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.*
+
+
+
+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.
+
+
+
+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.
+
+
+
+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:
+
+
+
+:::warning
+This endpoint works exclusively for users to generate API keys and facilitate integration between the WooCommerce REST API and an application. In no way is this endpoint intended to be used as login method for customers.
+:::
+
+#### URL parameters
+
+| Parameter | Type | Description |
+|----------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `app_name` | string | Your APP name `MANDATORY` |
+| `scope` | string | Level of access. Available: `read`, `write` and `read_write` `MANDATORY` |
+| `user_id` | string | User 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_url` | string | URL the user will be redirected to after authentication `MANDATORY` |
+| `callback_url` | string | URL 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:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+# 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"
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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;
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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))
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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}"
+```
+
+ </TabItem>
+</Tabs>
+
+> 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:
+
+
+
+#### 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](http://en.wikipedia.org/wiki/Basic_access_authentication) by providing the REST API Consumer Key as the username and the REST API Consumer Secret as the password.
+
+> HTTP Basic Auth example
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://www.example.com/wp-json/wc/v3/orders \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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'
+});
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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'
+ ]
+);
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+from woocommerce import API
+
+wcapi = API(
+ url="https://example.com",
+ consumer_key="consumer_key",
+ consumer_secret="consumer_secret",
+ wp_api=True,
+ version="wc/v3"
+)
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+require "woocommerce_api"
+
+woocommerce = WooCommerce::API.new(
+ "https://example.com",
+ "consumer_key",
+ "consumer_secret",
+ {
+ wp_json: true,
+ version: "wc/v3"
+ }
+)
+```
+
+ </TabItem>
+</Tabs>
+
+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:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://www.example.com/wp-json/wc/v3/orders?consumer_key=123&consumer_secret=abc
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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
+});
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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
+ ]
+);
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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
+)
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+ }
+)
+```
+
+ </TabItem>
+</Tabs>
+
+## Authentication over HTTP
+
+You must use [OAuth 1.0a "one-legged" authentication](http://tools.ietf.org/html/rfc5849) 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](https://dev.twitter.com/oauth/overview/percent-encoding-parameters) every key and value that will be signed.
+2. Sort the list of parameters alphabetically by encoded key.
+3. 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.
+
+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. Append the `&` character to the output string.
+3. [Percent encode](https://dev.twitter.com/oauth/overview/percent-encoding-parameters) the URL and append it to the output string.
+4. Append the `&` character to the output string.
+5. [Percent encode](https://dev.twitter.com/oauth/overview/percent-encoding-parameters) the parameter string and append it to the output string.
+
+> 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](http://php.net/manual/en/function.hash-hmac.php) 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](https://github.com/woocommerce/woocommerce/blob/master/includes/class-wc-rest-authentication.php#L185) 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.
diff --git a/docs/apis/rest-api/index.mdx b/docs/apis/rest-api/index.mdx
new file mode 100644
index 00000000000..ebc9411b8d3
--- /dev/null
+++ b/docs/apis/rest-api/index.mdx
@@ -0,0 +1,305 @@
+---
+sidebar_label: 'Introduction'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# WooCommerce REST API
+
+WooCommerce (WC) 2.6+ is fully integrated with the WordPress [REST](http://en.wikipedia.org/wiki/Representational_State_Transfer) 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.
+
+## Requirements
+
+To use the REST API you must be using:
+
+- WooCommerce 3.5+
+- WordPress 4.4+
+- Pretty permalinks in **Settings > Permalinks** (default permalinks will not work)
+
+You may access the API over either HTTP or HTTPS, but *HTTPS is recommended where possible*.
+
+:::note
+You are **not** required to install the [WP REST API (WP API)](https://wordpress.org/plugins/rest-api/) plugin.
+:::
+
+If you use ModSecurity and see `501 Method Not Implemented` errors, see [this issue](https://github.com/woocommerce/woocommerce/issues/9838) for details.
+
+## Libraries and tools
+
+### Official libraries
+
+- [JavaScript](https://www.npmjs.com/package/@woocommerce/woocommerce-rest-api) Library
+- [PHP](https://packagist.org/packages/automattic/woocommerce) Library
+- [Python](https://pypi.python.org/pypi/WooCommerce) Library
+- [Ruby](https://rubygems.org/gems/woocommerce_api) Library
+
+<Tabs>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+// 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
+});
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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
+ ]
+);
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+# 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
+)
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+# 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
+ }
+)
+```
+
+ </TabItem>
+</Tabs>
+
+### Third party libraries
+
+- [Java](https://github.com/icoderman/wc-api-java) Library
+- [.NET](https://github.com/XiaoFaye/WooCommerce.NET) Library
+- [Android](https://github.com/gilokimu/WooDroid) Library
+
+:::note
+We don't offer support for third party libraries. If you have questions about how to use any of these libraries, contact the respective authors.
+:::
+
+### Tools
+
+- [Insomnia](https://insomnia.rest) - Cross-platform GraphQL and REST client, available for Mac, Windows, and Linux.
+- [Postman](https://www.getpostman.com/) - Cross-platform REST client, available for Mac, Windows, and Linux.
+- [RequestBin](https://requestbin.com) - Allows you test webhooks.
+- [Hookbin](https://hookbin.com/) - Another tool to test webhooks.
+
+## Generate keys
+
+To start using REST API, you first need to generate API keys.
+
+1. Go to **WooCommerce > Settings > Advanced**
+2. Go to the **REST API** tab and click **Add key**
+3. Give the key a description for your own reference, choose a user with access to orders etc, and give the key **read/write** permissions
+4. Click **Generate API key**
+5. Your keys will be shown - do not close this tab yet, the secret will be hidden if you try to view the key again
+
+
+
+## Make a basic request
+
+The request URL we'll test is `wp-json/wc/v3/orders`. On localhost the full URL may look something like this: `https://localhost:8888/wp-json/wc/v3/orders`. Modify this to use your own site URL.
+
+In Postman, you need to set the fields for request type, request URL, and the settings on the authorization tab. For Authorization, choose **basic auth** and enter your **consumer key** and **consumer secret** keys from WooCommerce into the username and password fields.
+
+Once done, hit send and you'll see the JSON response from the API if all worked well:
+
+
+
+Insomnia is almost identical to Postman; fill in the same fields and again use basic auth:
+
+
+
+## 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 empty 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:
+
+```http
+GET /wp-json/wc/v3?_jsonp=callback
+```
+
+## 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:
+
+```http
+GET /orders?per_page=15
+```
+
+You can specify further pages with the `?page` parameter:
+
+```http
+GET /orders?page=2
+```
+
+You may also specify the offset from the first resource using the `?offset` parameter:
+
+```http
+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.
+
+### Link header
+
+Pagination info is included in the [Link Header](http://tools.ietf.org/html/rfc5988). 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"
+```
+
+| Value | Description |
+|---------|----------------------------------------------------------|
+| `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. |
+
+## Errors
+
+Occasionally you might encounter errors when accessing the REST API. There are four possible types:
+
+| Error Code | Error Type |
+|-----------------------------|-------------------------------------------------------------|
+| `400 Bad Request` | Invalid request, e.g. using an unsupported HTTP method |
+| `401 Unauthorized` | Authentication or permission error, e.g. incorrect API keys |
+| `404 Not Found` | Requests to resources that don't exist or are missing |
+| `500 Internal Server Error` | Server error |
+
+Errors return both an appropriate HTTP status code and response object which contains a `code`, `message` and `data` attribute:
+
+```json
+{
+ "code": "woocommerce_rest_term_invalid",
+ "message": "Resource doesn't exist.",
+ "data": {
+ "status": 404
+ }
+}
+```
+
+## Common connection issues
+
+### Connection issues with localhost and self-signed SSL certificates
+
+If you're having problems connecting to the REST API on your localhost and seeing SSL errors, you need to disable SSL verification.
+
+In Postman you can find this in the settings:
+
+
+
+Insomnia also has this setting in the preferences area:
+
+
+
+### 401 Unauthorized
+
+Your API keys or signature is wrong. Ensure that:
+
+- The user you generated API keys for actually has access to those resources
+- The username when authenticating is your consumer key
+- The password when authenticating is your consumer secret
+- Make a new set of keys to be sure
+
+If your server utilizes FastCGI, check that your [authorization headers are properly read](https://web.archive.org/web/20230330133128/https://support.metalocator.com/en/articles/1654091-wp-json-basic-auth-with-fastcgi).
+
+### Consumer key is missing
+
+Occasionally 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:
+
+```text
+https://local.wordpress.dev/wp-json/wc/v2/orders?consumer_key=XXXX&consumer_secret=XXXX
+```
+
+### Server does not support POST/DELETE/PUT
+
+Ideally, your server should be configured to accept these types of API request, but if not you can use the [`_method` property](https://developer.wordpress.org/rest-api/using-the-rest-api/global-parameters/#_method-or-x-http-method-override-header).
+
+## API version history
+
+| API Version | WC Version | WP Version |
+|-------------|----------------|--------------|
+| `v3` | 3.5.x or later | 4.4 or later |
+| `v2` | 3.0.x or later | 4.4 or later |
+| `v1` | 2.6.x or later | 4.4 or later |
+
+## Learn more
+
+Learn more about the REST API checking the [official WordPress REST API documentation](https://developer.wordpress.org/rest-api/).
diff --git a/docs/apis/rest-api/v1/_category_.json b/docs/apis/rest-api/v1/_category_.json
new file mode 100644
index 00000000000..67133d43973
--- /dev/null
+++ b/docs/apis/rest-api/v1/_category_.json
@@ -0,0 +1,4 @@
+{
+ "label": "v1",
+ "position": 5
+}
diff --git a/docs/apis/rest-api/v1/coupons.mdx b/docs/apis/rest-api/v1/coupons.mdx
new file mode 100644
index 00000000000..a909fef5b06
--- /dev/null
+++ b/docs/apis/rest-api/v1/coupons.mdx
@@ -0,0 +1,1015 @@
+---
+sidebar_position: 4
+sidebar_label: 'Coupons'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Coupons
+The coupons API allows you to create, view, update, and delete individual, or a batch, of coupon codes.
+
+## Coupon properties
+| Attribute | Type | Description |
+|-------------------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the object. `READ-ONLY` |
+| `code` | string | Coupon code. `MANDATORY` |
+| `date_created` | date-time | The date the coupon was created, in the site's timezone. `READ-ONLY` |
+| `date_modified` | date-time | The date the coupon was last modified, in the site's timezone. `READ-ONLY` |
+| `description` | string | Coupon description. |
+| `discount_type` | string | Determines the type of discount that will be applied. Options: `fixed_cart`, `percent`, `fixed_product` and `percent_product`. Default: `fixed_cart`. |
+| `amount` | string | The amount of discount. |
+| `expiry_date` | string | UTC DateTime when the coupon expires. |
+| `usage_count` | integer | Number of times the coupon has been used already. `READ-ONLY` |
+| `individual_use` | boolean | Whether coupon can only be used individually. |
+| `product_ids` | array | List of product ID's the coupon can be used on. |
+| `exclude_product_ids` | array | List of product ID's the coupon cannot be used on. |
+| `usage_limit` | integer | How many times the coupon can be used. |
+| `usage_limit_per_user` | integer | How many times the coupon can be used per customer. |
+| `limit_usage_to_x_items` | integer | Max number of items in the cart the coupon can be applied to. |
+| `free_shipping` | boolean | Define if can be applied for free shipping. |
+| `product_categories` | array | List of category ID's the coupon applies to. |
+| `excluded_product_categories` | array | List of category ID's the coupon does not apply to. |
+| `exclude_sale_items` | boolean | Define if should not apply when have sale items. |
+| `minimum_amount` | string | Minimum order amount that needs to be in the cart before coupon applies. |
+| `maximum_amount` | string | Maximum order amount allowed when using the coupon. |
+| `email_restrictions` | array | List of email addresses that can use this coupon. |
+| `used_by` | array | List of user IDs who have used the coupon. `READ-ONLY` |
+
+## Create a coupon
+This API helps you to create a new coupon.
+
+```http
+POST /wp-json/wc/v1/coupons
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a coupon
+This API lets you retrieve and view a specific coupon by ID.
+
+```http
+GET /wp-json/wc/v1/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/coupons/113 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("coupons/113")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('coupons/113')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("coupons/113").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("coupons/113").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all coupons
+This API helps you to list all the coupons that have been created.
+
+```http
+GET /wp-json/wc/v1/coupons
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/coupons \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("coupons")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('coupons')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("coupons").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("coupons").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------------|---------|---------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `date`, Options: `date`, `id`, `include`, `title` and `slug`. |
+| `code` | string | Limit result set to resources with a specific code. |
+
+## Update a coupon
+This API lets you make changes to a coupon.
+
+```http
+PUT /wp-json/wc/v1/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ amount: 5
+};
+
+WooCommerce.put("coupons/113", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'amount' => 5
+];
+
+print_r($woocommerce->put('coupons/113', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "amount": 5
+}
+
+print(wcapi.put("coupons/113", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ amount: 5
+}
+
+woocommerce.put("coupons/113", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a coupon
+This API helps you delete a coupon.
+
+```http
+DELETE /wp-json/wc/v1/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/coupons/113?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("coupons/113", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('coupons/113', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("coupons/113", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("coupons/113", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|--------------------------------------------------------------------------|
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/coupons/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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("coupons/batch", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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('coupons/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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("coupons/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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("coupons/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/customers.mdx b/docs/apis/rest-api/v1/customers.mdx
new file mode 100644
index 00000000000..1123dbb4316
--- /dev/null
+++ b/docs/apis/rest-api/v1/customers.mdx
@@ -0,0 +1,1661 @@
+---
+sidebar_position: 5
+sidebar_label: 'Customers'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Customers
+The customer API allows you to create, view, update, and delete individual, or a batch, of customers.
+
+## Customer properties
+| Attribute | Type | Description |
+|-----------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the customer was created, in the site's timezone. `READ-ONLY` |
+| `date_modified` | date-time | The date the customer was last modified, in the site's timezone. `READ-ONLY` |
+| `email` | string | The email address for the customer. `MANDATORY` |
+| `first_name` | string | Customer first name. |
+| `last_name` | string | Customer last name. |
+| `username` | string | Customer 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` |
+| `password` | string | Customer password. Can be generated automatically with [`wp_generate_password()`](http://codex.wordpress.org/Function_Reference/wp_generate_password) if the "Automatically generate customer password" option is enabled, check the index meta for `generate_password` `WRITE-ONLY` `MAYBE MANDATORY` |
+| `last_order` | array | Last order data. See [Customer Last Order properties](#customer-last-order-properties). `READ-ONLY` |
+| `orders_count` | integer | Quantity of orders made by the customer. `READ-ONLY` |
+| `total_spent` | string | Total amount spent. `READ-ONLY` |
+| `avatar_url` | string | Avatar URL. |
+| `billing` | array | List of billing address data. See [Billing Address properties](#billing-address-properties). |
+| `shipping` | array | List of shipping address data. See [Shipping Address properties](#shipping-address-properties). |
+
+### Customer last order properties
+| Attribute | Type | Description |
+|-----------|-----------|------------------------------------------------------------------------------------|
+| `id` | integer | Last order ID. `READ-ONLY` |
+| `date` | date-time | UTC DateTime of the customer last order. `READ-ONLY` |
+
+### Billing address properties
+| Attribute | Type | Description |
+|--------------|--------|------------------------------------------------------|
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1. |
+| `address_2` | string | Address line 2. |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | ISO code of the country. |
+| `email` | string | Email address. |
+| `phone` | string | Phone number. |
+
+### Shipping address properties
+| Attribute | Type | Description |
+|--------------|--------|------------------------------------------------------|
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1. |
+| `address_2` | string | Address line 2. |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | ISO code of the country. |
+
+## Create a customer
+This API helps you to create a new customer.
+
+```http
+POST /wp-json/wc/v1/customers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a customer
+This API lets you retrieve and view a specific customer by ID.
+
+```http
+GET /wp-json/wc/v1/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/customers/2 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("customers/2")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers/2')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers/2").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers/2").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all customers
+This API helps you to view all the customers.
+
+```http
+GET /wp-json/wc/v1/customers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/customers \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("customers")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`, Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `name`. Options: `id`, `include`, `name` and `registered_date`. |
+| `email` | string | Limit result set to resources with a specific email. |
+| `role` | string | Limit 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
+PUT /wp-json/wc/v1/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'first_name' => 'James',
+ 'billing' => [
+ 'first_name' => 'James'
+ ],
+ 'shipping' => [
+ 'first_name' => 'James'
+ ]
+];
+
+print_r($woocommerce->put('customers/2', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "first_name": "James",
+ "billing": {
+ "first_name": "James"
+ },
+ "shipping": {
+ "first_name": "James"
+ }
+}
+
+print(wcapi.put("customers/2", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ first_name: "James",
+ billing: {
+ first_name: "James"
+ },
+ shipping: {
+ first_name: "James"
+ }
+}
+
+woocommerce.put("customers/2", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a customer
+This API helps you delete a customer.
+
+```http
+DELETE /wp-json/wc/v1/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/customers/2?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("customers/2", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('customers/2', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("customers/2", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("customers/2", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required to be `true`, as resource does not support trashing. |
+
+## Batch update customers
+This API helps you to batch create, update and delete multiple customers.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/customers/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve customer downloads
+This API lets you retrieve customer downloads permissions.
+
+```http
+GET /wp-json/wc/v1/customers/<id>/downloads
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/customers/2/downloads \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("customers/2/downloads")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers/2/downloads')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers/2/downloads").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers/2/downloads").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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 – 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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+### Customer downloads properties
+| Attribute | Type | Description |
+|-----------------------|---------|------------------------------------------------------------------------------------------------------------------|
+| `download_url` | string | Download file URL. `READ-ONLY` |
+| `download_id` | string | Download ID (MD5). `READ-ONLY` |
+| `product_id` | integer | Downloadable product ID. `READ-ONLY` |
+| `download_name` | string | Downloadable file name. `READ-ONLY` |
+| `order_id` | integer | Order ID. `READ-ONLY` |
+| `order_key` | string | Order key. `READ-ONLY` |
+| `downloads_remaining` | string | Amount of downloads remaining. `READ-ONLY` |
+| `access_expires` | string | The date when the download access expires, in the site's timezone. `READ-ONLY` |
+| `file` | array | File details with `name` (file name) and `file` (file URL) attributes. `READ-ONLY` |
diff --git a/docs/apis/rest-api/v1/images/woocommerce-api-key-generated.png b/docs/apis/rest-api/v1/images/woocommerce-api-key-generated.png
new file mode 100644
index 00000000000..705d505d3ef
Binary files /dev/null and b/docs/apis/rest-api/v1/images/woocommerce-api-key-generated.png differ
diff --git a/docs/apis/rest-api/v1/images/woocommerce-api-keys-settings.png b/docs/apis/rest-api/v1/images/woocommerce-api-keys-settings.png
new file mode 100644
index 00000000000..51ff26b433e
Binary files /dev/null and b/docs/apis/rest-api/v1/images/woocommerce-api-keys-settings.png differ
diff --git a/docs/apis/rest-api/v1/images/woocommerce-auth-endpoint-example.png b/docs/apis/rest-api/v1/images/woocommerce-auth-endpoint-example.png
new file mode 100644
index 00000000000..d10d2413952
Binary files /dev/null and b/docs/apis/rest-api/v1/images/woocommerce-auth-endpoint-example.png differ
diff --git a/docs/apis/rest-api/v1/images/woocommerce-auth-endpoint-flow.png b/docs/apis/rest-api/v1/images/woocommerce-auth-endpoint-flow.png
new file mode 100644
index 00000000000..82907e81a84
Binary files /dev/null and b/docs/apis/rest-api/v1/images/woocommerce-auth-endpoint-flow.png differ
diff --git a/docs/apis/rest-api/v1/images/woocommerce-creating-api-keys.png b/docs/apis/rest-api/v1/images/woocommerce-creating-api-keys.png
new file mode 100644
index 00000000000..aa06315fe6d
Binary files /dev/null and b/docs/apis/rest-api/v1/images/woocommerce-creating-api-keys.png differ
diff --git a/docs/apis/rest-api/v1/index.mdx b/docs/apis/rest-api/v1/index.mdx
new file mode 100644
index 00000000000..2df518496b6
--- /dev/null
+++ b/docs/apis/rest-api/v1/index.mdx
@@ -0,0 +1,11 @@
+---
+title: REST API v1
+slug: /apis/rest-api/v1
+sidebar_position: 0
+---
+
+import DocCardList from '@theme/DocCardList';
+
+Legacy version of the WooCommerce REST API. Use `/wp-json/wc/v1/` endpoints. Consider migrating to v3 for new integrations.
+
+<DocCardList />
diff --git a/docs/apis/rest-api/v1/order-notes.mdx b/docs/apis/rest-api/v1/order-notes.mdx
new file mode 100644
index 00000000000..0851b57021e
--- /dev/null
+++ b/docs/apis/rest-api/v1/order-notes.mdx
@@ -0,0 +1,396 @@
+---
+sidebar_position: 7
+sidebar_label: 'Order notes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+|-----------------|-----------|---------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the order note was created, in the site's timezone. `READ-ONLY` |
+| `note` | string | Order note. `REQUIRED` |
+| `customer_note` | boolean | Shows/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
+POST /wp-json/wc/v1/orders/<id>/notes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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!!!"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ note: "Order ok!!!"
+};
+
+WooCommerce.post("orders/645/notes", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'note' => 'Order ok!!!'
+];
+
+print_r($woocommerce->post('orders/645/notes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "note": "Order ok!!!"
+}
+
+print(wcapi.post("orders/645/notes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ note: "Order ok!!!"
+}
+
+woocommerce.post("orders/645/notes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an order note
+This API lets you retrieve and view a specific note from an order.
+
+```http
+GET /wp-json/wc/v1/orders/<id>/notes/<note_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/orders/645/notes/51 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/645/notes/51")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/645/notes/51')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/645/notes/51").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/645/notes/51").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all order notes
+This API helps you to view all the notes from an order.
+
+```http
+GET /wp-json/wc/v1/orders/<id>/notes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/orders/645/notes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/645/notes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/645/notes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/645/notes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/645/notes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete an order note
+This API helps you delete an order note.
+
+```http
+DELETE /wp-json/wc/v1/orders/<id>/notes/<note_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/orders/645/notes/51?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("orders/645/notes/51", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/645/notes/51', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/645/notes/51", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/645/notes/51", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v1/order-refunds.mdx b/docs/apis/rest-api/v1/order-refunds.mdx
new file mode 100644
index 00000000000..44e557ccbe1
--- /dev/null
+++ b/docs/apis/rest-api/v1/order-refunds.mdx
@@ -0,0 +1,459 @@
+---
+sidebar_position: 8
+sidebar_label: 'Order refunds'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Refunds
+The refunds API allows you to create, view, and delete individual refunds.
+
+## Refund properties
+| Attribute | Type | Description |
+|----------------|-----------|----------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the order refund was created, in the site's timezone. `READ-ONLY` |
+| `amount` | string | Refund amount. `REQUIRED` |
+| `reason` | string | Reason for refund. |
+| `line_items` | array | Line items data. See [Refunds Line Items properties](#refund-line-item-properties). |
+
+### Refund line item properties
+| Attribute | Type | Description |
+|----------------|---------|------------------------------------------------------------------------------------------------|
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Product name. `READ-ONLY` |
+| `sku` | string | Product SKU. `READ-ONLY` |
+| `product_id` | integer | Product ID. |
+| `variation_id` | integer | Variation ID, if applicable. |
+| `quantity` | integer | Quantity ordered. |
+| `tax_class` | string | Tax class of product. `READ-ONLY` |
+| `price` | string | Product price. `READ-ONLY` |
+| `subtotal` | string | Line subtotal (before discounts). |
+| `subtotal_tax` | string | Line subtotal tax (before discounts). |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). |
+| `taxes` | array | Line total tax with `id`, `total` and `subtotal`. `READ-ONLY` |
+| `meta` | array | Line 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
+POST /wp-json/wc/v1/orders/<id>/refunds
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ amount: "10"
+};
+
+WooCommerce.post("orders/116/refunds", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'amount' => '10'
+];
+
+print_r($woocommerce->post('orders/116/refunds', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "amount": "10"
+}
+
+print(wcapi.post("orders/116/refunds", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ amount: "10"
+}
+
+woocommerce.post("orders/116/refunds", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a refund
+This API lets you retrieve and view a specific refund from an order.
+
+```http
+GET /wp-json/wc/v1/orders/<id>/refunds/<refund_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/orders/116/refunds/150 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/116/refunds/150")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/116/refunds/150')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/116/refunds/150").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/116/refunds/150").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------|
+| `dp` | string | Number of decimal points to use in each resource. |
+
+## List all refunds
+This API helps you to view all the refunds from an order.
+
+```http
+GET /wp-json/wc/v1/orders/<id>/refunds
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/orders/116/refunds \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/116/refunds")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/116/refunds')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/116/refunds").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/116/refunds").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------------|---------|---------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `date`, Options: `date`, `id`, `include`, `title` and `slug`. |
+| `dp` | string | Number of decimal points to use in each resource. |
+
+## Delete a refund
+This API helps you delete an order refund.
+
+```http
+DELETE /wp-json/wc/v1/orders/<id>/refunds/<refund_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/orders/116/refunds/150?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("orders/116/refunds/150", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/116/refunds/150', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/116/refunds/150", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/116/refunds/150", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v1/orders.mdx b/docs/apis/rest-api/v1/orders.mdx
new file mode 100644
index 00000000000..8cabdde0309
--- /dev/null
+++ b/docs/apis/rest-api/v1/orders.mdx
@@ -0,0 +1,2746 @@
+---
+sidebar_position: 6
+sidebar_label: 'Orders'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Orders
+The orders API allows you to create, view, update, and delete individual, or a batch, of orders.
+
+## Order properties
+| Attribute | Type | Description |
+|------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `parent_id` | integer | Parent order ID. |
+| `status` | string | Order status. Default is `pending`. Options (plugins may include new status): `pending`, `processing`, `on-hold`, `completed`, `cancelled`, `refunded` and `failed`. |
+| `order_key` | string | Order key. `READ-ONLY` |
+| `number` | string | Order number. `READ-ONLY` |
+| `currency` | string | Currency the order was created with, in ISO format, e.g `USD`. Default is the current store currency. |
+| `version` | string | Version of WooCommerce when the order was made. `READ-ONLY` |
+| `prices_include_tax` | boolean | Shows if the prices included tax during checkout. `READ-ONLY` |
+| `date_created` | date-time | The date the order was created, in the site's timezone. `READ-ONLY` |
+| `date_modified` | date-time | The date the order was last modified, in the site's timezone. `READ-ONLY` |
+| `customer_id` | integer | User ID who owns the order. Use `0` for guests. Default is `0`. |
+| `discount_total` | string | Total discount amount for the order. `READ-ONLY` |
+| `discount_tax` | string | Total discount tax amount for the order. `READ-ONLY` |
+| `shipping_total` | string | Total shipping amount for the order. `READ-ONLY` |
+| `shipping_tax` | string | Total shipping tax amount for the order. `READ-ONLY` |
+| `cart_tax` | string | Sum of line item taxes only. `READ-ONLY` |
+| `total` | string | Grand total. `READ-ONLY` |
+| `total_tax` | string | Sum of all taxes. `READ-ONLY` |
+| `billing` | object | Billing address. See [Customer Billing Address properties](#billing-address-properties). |
+| `shipping` | object | Shipping address. See [Customer Shipping Address properties](#shipping-address-properties). |
+| `payment_method` | string | Payment method ID. |
+| `payment_method_title` | string | Payment method title. |
+| `set_paid` | boolean | Define if the order is paid. It will set the status to processing and reduce stock items. Default is `false`. `WRITE-ONLY` |
+| `transaction_id` | string | Unique transaction ID. In write-mode only is available if `set_paid` is `true`. |
+| `customer_ip_address` | string | Customer's IP address. `READ-ONLY` |
+| `customer_user_agent` | string | User agent of the customer. `READ-ONLY` |
+| `created_via` | string | Shows where the order was created. `READ-ONLY` |
+| `customer_note` | string | Note left by customer during checkout. |
+| `date_completed` | date-time | The date the order was completed, in the site's timezone. `READ-ONLY` |
+| `date_paid` | date-time | The date the order has been paid, in the site's timezone. `READ-ONLY` |
+| `cart_hash` | string | MD5 hash of cart items to ensure orders are not modified. `READ-ONLY` |
+| `line_items` | array | Line items data. See [Line Items properties](#line-item-properties). |
+| `tax_lines` | array | Tax lines data. See [Tax Lines properties](#tax-line-properties). `READ-ONLY` |
+| `shipping_lines` | array | Shipping lines data. See [Shipping Lines properties](#shipping-line-properties). |
+| `fee_lines` | array | Fee lines data. See [Fee Lines Properties](#fee-line-properties). |
+| `coupon_lines` | array | Coupons line data. See [Coupon Lines properties](#coupon-line-properties). |
+| `refunds` | array | List of refunds. See [Refund line properties](#refund-line-properties). `READ-ONLY` |
+
+### Billing address properties
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1. |
+| `address_2` | string | Address line 2. |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | ISO code of the country. |
+| `email` | string | Email address. |
+| `phone` | string | Phone number. |
+
+### Shipping address properties
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1. |
+| `address_2` | string | Address line 2. |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | ISO code of the country. |
+
+### Line item properties
+| Attribute | Type | Description |
+|----------------|---------|------------------------------------------------------------------------------------------------|
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Product name. `READ-ONLY` |
+| `sku` | string | Product SKU. `READ-ONLY` |
+| `product_id` | integer | Product ID. |
+| `variation_id` | integer | Variation ID, if applicable. |
+| `quantity` | integer | Quantity ordered. |
+| `tax_class` | string | Tax class of product. `READ-ONLY` |
+| `price` | string | Product price. `READ-ONLY` |
+| `subtotal` | string | Line subtotal (before discounts). |
+| `subtotal_tax` | string | Line subtotal tax (before discounts). |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). |
+| `taxes` | array | Line taxes with `id`, `total` and `subtotal`. `READ-ONLY` |
+| `meta` | array | Line item meta data with `key`, `label` and `value`. `READ-ONLY` |
+
+### Tax line properties
+| Attribute | Type | Description |
+|----------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Item ID. `READ-ONLY` |
+| `rate_code` | string | Tax rate code. `READ-ONLY` |
+| `rate_id` | string | Tax rate ID. `READ-ONLY` |
+| `label` | string | Tax rate label. `READ-ONLY` |
+| `compound` | boolean | Show if is a compound tax rate. Compound tax rates are applied on top of other tax rates. `READ-ONLY` |
+| `tax_total` | string | Tax total (not including shipping taxes). `READ-ONLY` |
+| `shipping_tax_total` | string | Shipping tax total. `READ-ONLY` |
+
+### Shipping line properties
+| Attribute | Type | Description |
+|----------------|---------|-----------------------------------------------------------------------------|
+| `id` | integer | Item ID. `READ-ONLY` |
+| `method_title` | string | Shipping method name. |
+| `method_id` | string | Shipping method ID. `REQUIRED` |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes with `id` and `total`. `READ-ONLY` |
+
+### Fee line properties
+| Attribute | Type | Description |
+|--------------|---------|-----------------------------------------------------------------------------------------|
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Fee name. `REQUIRED` |
+| `tax_class` | string | Tax class. `REQUIRED IF THE FEE IS TAXABLE` |
+| `tax_status` | string | Tax status of fee. Set to `taxable` if need apply taxes. |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). |
+| `taxes` | array | Line taxes with `id`, `total` and `subtotal`. `READ-ONLY` |
+
+### Coupon line properties
+| Attribute | Type | Description |
+|----------------|---------|---------------------------------------------------------------|
+| `id` | integer | Item ID. `READ-ONLY` |
+| `code` | string | Coupon code. `REQUIRED` |
+| `discount` | string | Discount total. `REQUIRED` |
+| `discount_tax` | string | Discount total tax. `READ-ONLY` |
+
+### Refund line properties
+| Attribute | Type | Description |
+|-----------|---------|----------------------------------------------------------|
+| `id` | integer | Refund ID. `READ-ONLY` |
+| `reason` | string | Refund reason. `READ-ONLY` |
+| `total` | string | Refund total. `READ-ONLY` |
+
+## Create an order
+This API helps you to create a new order.
+
+```http
+POST /wp-json/wc/v1/orders
+```
+
+> Example of create a paid order:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an order
+This API lets you retrieve and view a specific order.
+
+```http
+GET /wp-json/wc/v1/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/orders/154 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/154")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/154')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/154").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/154").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------|
+| `dp` | string | Number of decimal points to use in each resource. |
+
+## List all orders
+This API helps you to view all the orders.
+
+```http
+GET /wp-json/wc/v1/orders
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/orders \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `date`, Options: `date`, `id`, `include`, `title` and `slug`. |
+| `status` | string | Limit 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`. |
+| `customer` | string | Limit result set to orders assigned a specific customer. |
+| `product` | string | Limit result set to orders assigned a specific product. |
+| `dp` | string | Number of decimal points to use in each resource. |
+
+## Update an Order
+This API lets you make changes to an order.
+
+### HTTP Request
+```http
+PUT /wp-json/wc/v1/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ status: "completed"
+};
+
+WooCommerce.put("orders/154", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'status' => 'completed'
+];
+
+print_r($woocommerce->put('orders/154', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "status": "completed"
+}
+
+print(wcapi.put("orders/154", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ status: "completed"
+}
+
+woocommerce.put("orders/154", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete an order
+This API helps you delete an order.
+
+```http
+DELETE /wp-json/wc/v1/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/orders/154?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("orders/154", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/154', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/154", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/154", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|-------------------------------------------------------------------------|
+| `force` | boolean | Use `true` to permanently delete the order. Default is `false`. |
+
+## Batch update orders
+This API helps you to batch create, update and delete multiple orders.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/orders/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/product-attribute-terms.mdx b/docs/apis/rest-api/v1/product-attribute-terms.mdx
new file mode 100644
index 00000000000..be5ddecadec
--- /dev/null
+++ b/docs/apis/rest-api/v1/product-attribute-terms.mdx
@@ -0,0 +1,876 @@
+---
+sidebar_position: 12
+sidebar_label: 'Product attribute terms'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+|---------------|---------|------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Term name. `REQUIRED` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `menu_order` | integer | Menu order, used to custom sort the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create an attribute term
+This API helps you to create a new product attribute term.
+
+```http
+POST /wp-json/wc/v1/products/attributes/<attribute_id>/terms
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "XXS"
+};
+
+WooCommerce.post("products/attributes/2/terms", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'XXS'
+];
+
+print_r($woocommerce->post('products/attributes/2/terms', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "XXS"
+}
+
+print(wcapi.post("products/attributes/2/terms", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "XXS"
+}
+
+woocommerce.post("products/attributes/2/terms", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an attribute term
+This API lets you retrieve a product attribute term by ID.
+
+```http
+GET /wp-json/wc/v1/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/attributes/2/terms/23 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/attributes/2/terms/23")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/2/terms/23')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/2/terms/23").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/2/terms/23").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all attribute terms
+This API lets you retrieve all terms from a product attribute.
+
+```http
+GET /wp-json/wc/v1/products/attributes/<attribute_id>/terms
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/attributes/2/terms \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/attributes/2/terms")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/2/terms')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/2/terms").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/2/terms").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|--------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `name`. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. |
+| `hide_empty` | bool | Whether to hide resources not assigned to any products. Default is `false`. |
+| `parent` | integer | Limit result set to resources assigned to a specific parent. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update an attribute term
+This API lets you make changes to a product attribute term.
+
+```http
+PUT /wp-json/wc/v1/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'XXS'
+];
+
+print_r($woocommerce->put('products/attributes/2/terms/23', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "XXS"
+}
+
+print(wcapi.put("products/attributes/2/terms/23", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "XXS"
+}
+
+woocommerce.put("products/attributes/2/terms/23", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete an attribute term
+This API helps you delete a product attribute term.
+
+```http
+DELETE /wp-json/wc/v1/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/products/attributes/2/terms/23?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/attributes/2/terms/23", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/attributes/2/terms/23', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/attributes/2/terms/23", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/attributes/2/terms/23", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/products/attributes/<attribute_id>/terms/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X POST https://example.com/wp-json/wc/v1/products/attributes/<attribute_id>/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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/product-attributes.mdx b/docs/apis/rest-api/v1/product-attributes.mdx
new file mode 100644
index 00000000000..700b80a107f
--- /dev/null
+++ b/docs/apis/rest-api/v1/product-attributes.mdx
@@ -0,0 +1,759 @@
+---
+sidebar_position: 11
+sidebar_label: 'Product attributes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product attributes
+The product attributes API allows you to create, view, update, and delete individual, or a batch, of product attributes.
+
+## Product attribute properties
+| Attribute | Type | Description |
+|----------------|---------|-----------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Attribute name. `REQUIRED` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `type` | string | Type of attribute. Default is `select`. Options: `select` and `text` (some plugins can include new types) |
+| `order_by` | string | Default sort order. Default is `menu_order`. Options: `menu_order`, `name`, `name_num` and `id`. |
+| `has_archives` | boolean | Enable/Disable attribute archives. Default is `false`. |
+
+## Create a product attribute
+This API helps you to create a new product attribute.
+
+```http
+POST /wp-json/wc/v1/products/attributes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Color',
+ 'slug' => 'pa_color',
+ 'type' => 'select',
+ 'order_by' => 'menu_order',
+ 'has_archives' => true
+];
+
+print_r($woocommerce->post('products/attributes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": True
+}
+
+print(wcapi.post("products/attributes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Color",
+ slug: "pa_color",
+ type: "select",
+ order_by: "menu_order",
+ has_archives: true
+}
+
+woocommerce.post("products/attributes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v1/products/attributes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product attribute
+This API lets you retrieve and view a specific product attribute by ID.
+
+```http
+GET /wp-json/wc/v1/products/attributes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/attributes/1 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/attributes/1")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/1')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/1").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/1").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v1/products/attributes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product attributes
+This API helps you to view all the product attributes.
+
+```http
+GET /wp-json/wc/v1/products/attributes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/attributes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/attributes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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/1"
+ }
+ ],
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a product attribute
+This API lets you make changes to a product attribute.
+
+```http
+PUT /wp-json/wc/v1/products/attributes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ order_by: "name"
+};
+
+WooCommerce.put("products/attributes/1", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'order_by' => 'name'
+];
+
+print_r($woocommerce->put('products/attributes/1', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "order_by": "name"
+}
+
+print(wcapi.put("products/attributes/1", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ order_by: "name"
+}
+
+woocommerce.put("products/attributes/1", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v1/products/attributes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product attribute
+This API helps you delete a product attribute.
+
+```http
+DELETE /wp-json/wc/v1/products/attributes/<id>
+```
+
+:::warning
+This also will delete all terms from the selected attribute.
+:::
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/products/attributes/1?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/attributes/1", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/attributes/1', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/attributes/1", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/attributes/1", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v1/products/attributes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/products/attributes/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Brand'
+ ],
+ [
+ 'name' => 'Publisher'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 2,
+ 'order_by' => 'name'
+ ]
+ ],
+ 'delete' => [
+ 1
+ ]
+];
+
+print_r($woocommerce->post('products/attributes/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Brand"
+ },
+ {
+ "name": "Publisher"
+ }
+ ],
+ "update": [
+ {
+ "id": 2,
+ "order_by": "name"
+ }
+ ],
+ "delete": [
+ 1
+ ]
+}
+
+print(wcapi.post("products/attributes/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Round toe"
+ },
+ {
+ name: "Flat"
+ }
+ ],
+ update: [
+ {
+ id: 2,
+ order_by: "name"
+ }
+ ],
+ delete: [
+ 1
+ ]
+}
+
+woocommerce.post("products/attributes/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v1/products/attributes"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/product-categories.mdx b/docs/apis/rest-api/v1/product-categories.mdx
new file mode 100644
index 00000000000..e388566a231
--- /dev/null
+++ b/docs/apis/rest-api/v1/product-categories.mdx
@@ -0,0 +1,1019 @@
+---
+sidebar_position: 13
+sidebar_label: 'Product categories'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product categories
+The product categories API allows you to create, view, update, and delete individual, or a batch, of categories.
+
+## Product category properties
+| Attribute | Type | Description |
+|---------------|---------|-----------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Category name. `REQUIRED` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `parent` | integer | The id for the parent of the resource. |
+| `description` | string | HTML description of the resource. |
+| `display` | string | Category archive display type. Default is `default`. Options: `default`, `products`, `subcategories` and `both` |
+| `image` | array | Image data. See [Category Image properties](#category-image-properties) |
+| `menu_order` | integer | Menu order, used to custom sort the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+### Category Image properties
+| Attribute | Type | Description |
+|-----------------|-----------|---------------------------------------------------------------------------------------------------------|
+| `id` | integer | Image ID (attachment ID). In write-mode used to attach pre-existing images. |
+| `date_created` | date-time | The date the image was created, in the site's timezone. `READ-ONLY` |
+| `date_modified` | date-time | The date the image was last modified, in the site's timezone. `READ-ONLY` |
+| `src` | string | Image URL. In write-mode used to upload new images. |
+| `title` | string | Image name. |
+| `alt` | string | Image alternative text. |
+
+## Create a product category
+This API helps you to create a new product category.
+
+```http
+POST /wp-json/wc/v1/products/categories
+```
+
+> Example of how to create a product category:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product category
+This API lets you retrieve a product category by ID.
+
+```http
+GET /wp-json/wc/v1/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/categories/9 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/categories/9")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/categories/9')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/categories/9").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/categories/9").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product categories
+This API lets you retrieve all product categories.
+
+```http
+GET /wp-json/wc/v1/products/categories
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/categories \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/categories")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/categories')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/categories").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/categories").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|--------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `name`. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. |
+| `hide_empty` | bool | Whether to hide resources not assigned to any products. Default is `false`. |
+| `parent` | integer | Limit result set to resources assigned to a specific parent. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a product category
+This API lets you make changes to a product category.
+
+```http
+PUT /wp-json/wc/v1/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description' => 'All kinds of clothes.'
+];
+
+print_r($woocommerce->put('products/categories/9', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "All kinds of clothes."
+}
+
+print(wcapi.put("products/categories/9", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "All kinds of clothes."
+}
+
+woocommerce.put("products/categories/9", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product category
+This API helps you delete a product category.
+
+```http
+DELETE /wp-json/wc/v1/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/products/categories/9?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/categories/9", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/categories/9', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/categories/9", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/categories/9", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/products/categories/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Albums'
+ ],
+ [
+ 'name' => 'Clothing'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 10,
+ 'description' => 'Nice hoodies'
+ ]
+ ],
+ 'delete' => [
+ 11,
+ 12
+ ]
+];
+
+print_r($woocommerce->post('products/categories/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Albums"
+ },
+ {
+ "name": "Clothing"
+ }
+ ],
+ "update": [
+ {
+ "id": 10,
+ "description": "Nice hoodies"
+ }
+ ],
+ "delete": [
+ 11,
+ 12
+ ]
+}
+
+print(wcapi.post("products/categories/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Albums"
+ },
+ {
+ name: "Clothing"
+ }
+ ],
+ update: [
+ {
+ id: 10,
+ description: "Nice hoodies"
+ }
+ ],
+ delete: [
+ 11,
+ 12
+ ]
+}
+
+woocommerce.post("products/categories/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/product-shipping-classes.mdx b/docs/apis/rest-api/v1/product-shipping-classes.mdx
new file mode 100644
index 00000000000..8a0984218c4
--- /dev/null
+++ b/docs/apis/rest-api/v1/product-shipping-classes.mdx
@@ -0,0 +1,741 @@
+---
+sidebar_position: 15
+sidebar_label: 'Product shipping classes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+|---------------|---------|------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Shipping class name. `REQUIRED` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create a shipping class
+This API helps you to create a new product shipping class.
+
+```http
+POST /wp-json/wc/v1/products/shipping_classes
+```
+
+> Example of how to create a product shipping class:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "Priority"
+};
+
+WooCommerce.post("products/shipping_classes", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Priority'
+];
+
+print_r($woocommerce->post('products/shipping_classes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Priority"
+}
+
+print(wcapi.post("products/shipping_classes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Priority"
+}
+
+woocommerce.post("products/shipping_classes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a shipping class
+This API lets you retrieve a product shipping class by ID.
+
+```http
+GET /wp-json/wc/v1/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/shipping_classes/32 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/shipping_classes/32")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/shipping_classes/32')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/shipping_classes/32").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/shipping_classes/32").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping classes
+This API lets you retrieve all product shipping classes.
+
+```http
+GET /wp-json/wc/v1/products/shipping_classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/shipping_classes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/shipping_classes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/shipping_classes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/shipping_classes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/shipping_classes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|--------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `name`. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. |
+| `hide_empty` | bool | Whether to hide resources not assigned to any products. Default is `false`. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a shipping class
+This API lets you make changes to a product shipping class.
+
+```http
+PUT /wp-json/wc/v1/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description' => 'Priority mail.'
+];
+
+print_r($woocommerce->put('products/shipping_classes/32', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "Priority mail."
+}
+
+print(wcapi.put("products/shipping_classes/32", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "Priority mail."
+}
+
+woocommerce.put("products/shipping_classes/32", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a shipping class
+This API helps you delete a product shipping class.
+
+```http
+DELETE /wp-json/wc/v1/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/products/shipping_classes/32?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/shipping_classes/32", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/shipping_classes/32', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/shipping_classes/32", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/shipping_classes/32", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/products/shipping_classes/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/product-tags.mdx b/docs/apis/rest-api/v1/product-tags.mdx
new file mode 100644
index 00000000000..d2c433a4b39
--- /dev/null
+++ b/docs/apis/rest-api/v1/product-tags.mdx
@@ -0,0 +1,741 @@
+---
+sidebar_position: 14
+sidebar_label: 'Product tags'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product tags
+The product tags API allows you to create, view, update, and delete individual, or a batch, of product tags.
+
+## Product tag properties
+| Attribute | Type | Description |
+|---------------|---------|------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Tag name. `REQUIRED` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create a product tag
+This API helps you to create a new product tag.
+
+```http
+POST /wp-json/wc/v1/products/tags
+```
+
+> Example of how to create a product tag:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "Leather Shoes"
+};
+
+WooCommerce.post("products/tags", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Leather Shoes'
+];
+
+print_r($woocommerce->post('products/tags', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Leather Shoes"
+}
+
+print(wcapi.post("products/tags", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Leather Shoes"
+}
+
+woocommerce.post("products/tags", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product tag
+This API lets you retrieve a product tag by ID.
+
+```http
+GET /wp-json/wc/v1/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/tags/34 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/tags/34")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/tags/34')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/tags/34").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/tags/34").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product tags
+This API lets you retrieve all product tag.
+
+```http
+GET /wp-json/wc/v1/products/tags
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/tags \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/tags")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/tags')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/tags").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/tags").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|--------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `name`. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. |
+| `hide_empty` | bool | Whether to hide resources not assigned to any products. Default is `false`. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a product tag
+This API lets you make changes to a product tag.
+
+```http
+PUT /wp-json/wc/v1/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ description: "Genuine leather."
+};
+
+WooCommerce.put("products/tags/34", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description' => 'Genuine leather.'
+];
+
+print_r($woocommerce->put('products/tags/34', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "Genuine leather."
+}
+
+print(wcapi.put("products/tags/34", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "Genuine leather."
+}
+
+woocommerce.put("products/tags/34", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product tag
+This API helps you delete a product tag.
+
+```http
+DELETE /wp-json/wc/v1/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/products/tags/34?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/tags/34", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/tags/34', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/tags/34", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/tags/34", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/products/tags/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Round toe'
+ ],
+ [
+ 'name' => 'Flat'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 34,
+ 'description' => 'Genuine leather.'
+ ]
+ ],
+ 'delete' => [
+ 35
+ ]
+];
+
+print_r($woocommerce->post('products/tags/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Round toe"
+ },
+ {
+ "name": "Flat"
+ }
+ ],
+ "update": [
+ {
+ "id": 34,
+ "description": "Genuine leather."
+ }
+ ],
+ "delete": [
+ 35
+ ]
+}
+
+print(wcapi.post("products/tags/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Round toe"
+ },
+ {
+ name: "Flat"
+ }
+ ],
+ update: [
+ {
+ id: 34,
+ description: "Genuine leather."
+ }
+ ],
+ delete: [
+ 35
+ ]
+}
+
+woocommerce.post("products/tags/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/products.mdx b/docs/apis/rest-api/v1/products.mdx
new file mode 100644
index 00000000000..46fd1c0cd1c
--- /dev/null
+++ b/docs/apis/rest-api/v1/products.mdx
@@ -0,0 +1,3608 @@
+---
+sidebar_position: 9
+sidebar_label: 'Products'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Products
+The products API allows you to create, view, update, and delete individual, or a batch, of products.
+
+## Product properties
+| Attribute | Type | Description |
+|----------------------|-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Product name. |
+| `slug` | string | Product slug. |
+| `permalink` | string | Product URL. `READ-ONLY` |
+| `date_created` | date-time | The date the product was created, in the site's timezone. `READ-ONLY` |
+| `date_modified` | date-time | The date the product was last modified, in the site's timezone. `READ-ONLY` |
+| `type` | string | Product type. Default is `simple`. Options (plugins may add new options): `simple`, `grouped`, `external`, `variable`. |
+| `status` | string | Product status (post status). Default is `publish`. Options (plugins may add new options): `draft`, `pending`, `private` and `publish`. |
+| `featured` | boolean | Featured product. Default is `false`. |
+| `catalog_visibility` | string | Catalog visibility. Default is `visible`. Options: `visible` (Catalog and search), `catalog` (Only in catalog), `search` (Only in search) and `hidden` (Hidden from all). |
+| `description` | string | Product description. |
+| `short_description` | string | Product short description. |
+| `sku` | string | Unique identifier. |
+| `price` | string | Current product price. This is setted from `regular_price` and `sale_price`. `READ-ONLY` |
+| `regular_price` | string | Product regular price. |
+| `sale_price` | string | Product sale price. |
+| `date_on_sale_from` | string | Start date of sale price. Date in the `YYYY-MM-DD` format. |
+| `date_on_sale_to` | string | Sets the sale end date. Date in the `YYYY-MM-DD` format. |
+| `price_html` | string | Price formatted in HTML, e.g. `<del><span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$ 3.00</span></span></del> <ins><span class=\"woocommerce-Price-amount amount\"><span class=\"woocommerce-Price-currencySymbol\">$ 2.00</span></span></ins>` `READ-ONLY` |
+| `on_sale` | boolean | Shows if the product is on sale. `READ-ONLY` |
+| `purchasable` | boolean | Shows if the product can be bought. `READ-ONLY` |
+| `total_sales` | integer | Amount of sales. `READ-ONLY` |
+| `virtual` | boolean | If the product is virtual. Virtual products are intangible and aren't shipped. Default is `false`. |
+| `downloadable` | boolean | If the product is downloadable. Downloadable products give access to a file upon purchase. Default is `false`. |
+| `downloads` | array | List of downloadable files. See [Downloads properties](#download-properties). |
+| `download_limit` | integer | Amount of times the product can be downloaded, the `-1` values means **unlimited re-downloads**. Default is `-1`. |
+| `download_expiry` | integer | Number 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_type` | string | Download type, this controls the [schema](http://schema.org/) on the front-end. Default is `standard`. Options: `'standard'` (Standard Product), `application` (Application/Software) and `music` (Music). |
+| `external_url` | string | Product external URL. Only for `external` products. |
+| `button_text` | string | Product external button text. Only for `external` products. |
+| `tax_status` | string | Tax status. Default is `taxable`. Options: `taxable`, `shipping` (Shipping only) and `none`. |
+| `tax_class` | string | Tax class. |
+| `manage_stock` | boolean | Stock management at product level. Default is `false`. |
+| `stock_quantity` | integer | Stock 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_stock` | boolean | Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend. Default is `true`. |
+| `backorders` | string | If 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_allowed` | boolean | Shows if backorders are allowed. `READ-ONLY` |
+| `backordered` | boolean | Shows if a product is on backorder (if the product have the `stock_quantity` negative). `READ-ONLY` |
+| `sold_individually` | boolean | Allow one item to be bought in a single order. Default is `false`. |
+| `weight` | string | Product weight in decimal format. |
+| `dimensions` | object | Product dimensions. See [Dimensions properties](#dimension-properties). |
+| `shipping_required` | boolean | Shows if the product need to be shipped. `READ-ONLY` |
+| `shipping_taxable` | boolean | Shows whether or not the product shipping is taxable. `READ-ONLY` |
+| `shipping_class` | string | Shipping class slug. Shipping classes are used by certain shipping methods to group similar products. |
+| `shipping_class_id` | integer | Shipping class ID. `READ-ONLY` |
+| `reviews_allowed` | boolean | Allow reviews. Default is `true`. |
+| `average_rating` | string | Reviews average rating. `READ-ONLY` |
+| `rating_count` | integer | Amount of reviews that the product have. `READ-ONLY` |
+| `related_ids` | array | List of related products IDs (`integer`). `READ-ONLY` |
+| `upsell_ids` | array | List 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_ids` | array | List of cross-sell products IDs. Cross-sells are products which you promote in the cart, based on the current product. |
+| `parent_id` | integer | Product parent ID (`post_parent`). |
+| `purchase_note` | string | Optional note to send the customer after purchase. |
+| `categories` | array | List of categories. See [Categories properties](#category-properties). |
+| `tags` | array | List of tags. See [Tags properties](#tag-properties). |
+| `images` | array | List of images. See [Images properties](#image-properties) |
+| `attributes` | array | List of attributes. See [Attributes properties](#attribute-properties). |
+| `default_attributes` | array | Defaults variation attributes, used only for variations and pre-selected attributes on the frontend. See [Default Attributes properties](#default-attribute-properties). |
+| `variations` | array | List of variations. See [Variations properties](#variation-properties) |
+| `grouped_products` | array | List of grouped products ID, only for `group` type products. `READ-ONLY` |
+| `menu_order` | integer | Menu order, used to custom sort products. |
+
+### Download properties
+| Attribute | Type | Description |
+|-----------|--------|----------------------------------------------------------------------|
+| `id` | string | File ID. |
+| `name` | string | File name. |
+| `file` | string | File URL. In write-mode you can use this property to send new files. |
+
+### Dimension properties
+| Attribute | Type | Description |
+|-----------|--------|-----------------------------------|
+| `length` | string | Product length in decimal format. |
+| `width` | string | Product width in decimal format. |
+| `height` | string | Product height in decimal format. |
+
+### Category properties
+| Attribute | Type | Description |
+|-----------|---------|----------------------------------------------------------|
+| `id` | integer | Category ID. |
+| `name` | string | Category name. `READ-ONLY` |
+| `slug` | string | Category slug. `READ-ONLY` |
+
+### Tag properties
+| Attribute | Type | Description |
+|-----------|---------|-----------------------------------------------------|
+| `id` | integer | Tag ID. |
+| `name` | string | Tag name. `READ-ONLY` |
+| `slug` | string | Tag slug. `READ-ONLY` |
+
+### Image properties
+| Attribute | Type | Description |
+|-----------------|-----------|---------------------------------------------------------------------------------------------------------|
+| `id` | integer | Image ID (attachment ID). In write-mode used to attach pre-existing images. |
+| `date_created` | date-time | The date the image was created, in the site's timezone. `READ-ONLY` |
+| `date_modified` | date-time | The date the image was last modified, in the site's timezone. `READ-ONLY` |
+| `src` | string | Image URL. In write-mode used to upload new images. |
+| `name` | string | Image name. |
+| `alt` | string | Image alternative text. |
+| `position` | integer | Image position. `0` means that the image is featured. |
+
+### Attribute properties
+| Attribute | Type | Description |
+|-------------|---------|-------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Attribute ID (required if is a global attribute). |
+| `name` | string | Attribute name (required if is a non-global attribute). |
+| `position` | integer | Attribute position. |
+| `visible` | boolean | Define if the attribute is visible on the "Additional Information" tab in the product's page. Default is `false`. |
+| `variation` | boolean | Define if the attribute can be used as variation. Default is `false`. |
+| `options` | array | List of available term names of the attribute. |
+
+### Default attribute properties
+| Attribute | Type | Description |
+|-----------|---------|---------------------------------------------------------|
+| `id` | integer | Attribute ID (required if is a global attribute). |
+| `name` | string | Attribute name (required if is a non-global attribute). |
+| `option` | string | Selected attribute term name. |
+
+### Variation properties
+| Attribute | Type | Description |
+|----------------------|-----------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Variation ID. `READ-ONLY` |
+| `date_created` | date-time | The date the variation was created, in the site's timezone. `READ-ONLY` |
+| `date_modified` | date-time | The date the variation was last modified, in the site's timezone. `READ-ONLY` |
+| `permalink` | string | Variation URL. `READ-ONLY` |
+| `sku` | string | Unique identifier. |
+| `price` | string | Current variation price. This is setted from `regular_price` and `sale_price`. `READ-ONLY` |
+| `regular_price` | string | Variation regular price. |
+| `sale_price` | string | Variation sale price. |
+| `date_on_sale_from` | string | Start date of sale price. Date in the `YYYY-MM-DD` format. |
+| `date_on_sale_to` | string | Start date of sale price. Date in the `YYYY-MM-DD` format. |
+| `on_sale` | boolean | Shows if the variation is on sale. `READ-ONLY` |
+| `purchasable` | boolean | Shows if the variation can be bought. `READ-ONLY` |
+| `visible` | boolean | If the variation is visible. |
+| `virtual` | boolean | If the variation is virtual. Virtual variations are intangible and aren't shipped. Default is `false`. |
+| `downloadable` | boolean | If the variation is downloadable. Downloadable variations give access to a file upon purchase. Default is `false`. |
+| `downloads` | array | List of downloadable files. See [Downloads properties](#download-properties). |
+| `download_limit` | integer | Amount of times the variation can be downloaded, the `-1` values means **unlimited re-downloads**. Default is `-1`. |
+| `download_expiry` | integer | Number 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_status` | string | Tax status. Default is `taxable`. Options: `taxable`, `shipping` (Shipping only) and `none`. |
+| `tax_class` | string | Tax class. |
+| `manage_stock` | boolean, string | Stock management at variation level. Possible values are either a boolean or `parent`. Default is `false`. |
+| `stock_quantity` | integer | Stock 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_stock` | boolean | Controls whether or not the variation is listed as "in stock" or "out of stock" on the frontend. Default is `true`. |
+| `backorders` | string | If 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_allowed` | boolean | Shows if backorders are allowed." `READ-ONLY` |
+| `backordered` | boolean | Shows if a variation is on backorder (if the variation have the `stock_quantity` negative). `READ-ONLY` |
+| `weight` | string | Variation weight in decimal format. |
+| `dimensions` | object | Variation dimensions. See [Dimensions properties](#dimension-properties). |
+| `shipping_class` | string | Shipping class slug. Shipping classes are used by certain shipping methods to group similar products. |
+| `shipping_class_id` | integer | Shipping class ID. `READ-ONLY` |
+| `image` | array | Variation featured image. Only position `0` will be used. See [Images properties](#image-properties). |
+| `attributes` | array | List of variation attributes. See [Variation Attributes properties](#variation-attribute-properties) |
+
+### Variation attribute properties
+| Attribute | Type | Description |
+|-----------|---------|---------------------------------------------------------|
+| `id` | integer | Attribute ID (required if is a global attribute). |
+| `name` | string | Attribute name (required if is a non-global attribute). |
+| `option` | string | Selected attribute term name. |
+
+## Create a product
+This API helps you to create a new product.
+
+```http
+POST /wp-json/wc/v1/products
+```
+
+> Example of how to create a `simple` product:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">R$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+> Example of how to create a `variable` product with global and non-global attributes:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">R$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product
+This API lets you retrieve and view a specific product by ID.
+
+```http
+GET /wp-json/wc/v1/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/162 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/162")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/162')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/162").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/162").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">R$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all products
+This API helps you to view all the products.
+
+```http
+GET /wp-json/wc/v1/products
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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\">R$</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\">R$</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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `date`, Options: `date`, `id`, `include`, `title` and `slug`. |
+| `slug` | string | Limit result set to products with a specific slug. |
+| `status` | string | Limit result set to products assigned a specific status. Default is `any`. Options: `any`, `draft`, `pending`, `private` and `publish`. |
+| `customer` | string | Limit result set to orders assigned a specific customer. |
+| `category` | string | Limit result set to products assigned a specific category, e.g. `?category=9,14`. |
+| `tag` | string | Limit result set to products assigned a specific tag, e.g. `?tag=9,14`. |
+| `shipping_class` | string | Limit result set to products assigned a specific shipping class, e.g. `?shipping_class=9,14`. |
+| `attribute` | string | Limit result set to products with a specific attribute, e.g. `?attribute=pa_color`. |
+| `attribute_term` | string | Limit result set to products with a specific attribute term (required an assigned `attribute`), e.g. `?attribute=pa_color&attribute_term=9,14`. |
+| `sku` | string | Limit result set to products with a specific SKU. |
+
+## Update a product
+This API lets you make changes to a product.
+
+```http
+PUT /wp-json/wc/v1/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ regular_price: "24.54"
+};
+
+WooCommerce.put("products/162", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'regular_price' => '24.54'
+];
+
+print_r($woocommerce->put('products/162', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "regular_price": "24.54"
+}
+
+print(wcapi.put("products/162", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ regular_price: "24.54"
+}
+
+woocommerce.put("products/162", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">R$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product
+This API helps you delete a product.
+
+```http
+DELETE /wp-json/wc/v1/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/products/162?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/162", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/162', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/162", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/162", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">R$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------------------|
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/products/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">R$</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\">R$</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\">R$</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\">R$</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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve product reviews
+This API lets you retrieve and view a specific product review by ID.
+
+```http
+GET /wp-json/wc/v1/products/<product_id>/reviews/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/162/reviews/9 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/162/reviews/9")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/162')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/162/reviews/9").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/162/reviews/9").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+### Product review properties
+| Attribute | Type | Description |
+|----------------|---------|----------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | string | The date the review was created, in the site's timezone. `READ-ONLY` |
+| `rating` | integer | Review rating (0 to 5). `READ-ONLY` |
+| `name` | string | Reviewer name. `READ-ONLY` |
+| `email` | string | Reviewer email. `READ-ONLY` |
+| `verified` | boolean | Shows if the reviewer bought the product or not. `READ-ONLY` |
+
+## List all product reviews
+This API lets you retrieve all reviews of a product.
+
+```http
+GET /wp-json/wc/v1/products/<product_id>/reviews
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/products/162/reviews \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/162/reviews")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/162/reviews')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/162/reviews").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/162/reviews").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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. <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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/reports.mdx b/docs/apis/rest-api/v1/reports.mdx
new file mode 100644
index 00000000000..923147d40e4
--- /dev/null
+++ b/docs/apis/rest-api/v1/reports.mdx
@@ -0,0 +1,361 @@
+---
+sidebar_position: 16
+sidebar_label: 'Reports'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+GET /wp-json/wc/v1/reports
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/reports \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("reports")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('reports')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("reports").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve sales report
+This API lets you retrieve and view a sales report.
+
+```http
+GET /wp-json/wc/v1/reports/sales
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$query = [
+ 'date_min' => '2016-05-03',
+ 'date_max' => '2016-05-04'
+];
+
+print_r($woocommerce->get('reports/sales', $query));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/sales?date_min=2016-05-03&date_max=2016-05-04").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+query = {
+ date_min: "2016-05-03",
+ date_max: "2016-05-04"
+}
+
+woocommerce.get("reports/sales", query).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Sales report properties
+| Attribute | Type | Description |
+|---------------------|---------|-----------------------------------------------------------------------|
+| `total_sales` | string | Gross sales in the period. `READ-ONLY` |
+| `net_sales` | string | Net sales in the period. `READ-ONLY` |
+| `average_sales` | string | Average net daily sales. `READ-ONLY` |
+| `total_orders` | integer | Total of orders placed. `READ-ONLY` |
+| `total_items` | integer | Total of items purchased. `READ-ONLY` |
+| `total_tax` | string | Total charged for taxes. `READ-ONLY` |
+| `total_shipping` | string | Total charged for shipping. `READ-ONLY` |
+| `total_refunds` | number | Total of refunded orders. `READ-ONLY` |
+| `total_discount` | integer | Total of coupons used. `READ-ONLY` |
+| `totals_grouped_by` | string | Group type. `READ-ONLY` |
+| `totals` | array | Totals. `READ-ONLY` |
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------|--------|-------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Default is `view`. Options: `view`. |
+| `period` | string | Report period. Default is today's date. Options: `week`, `month`, `last_month` and `year` |
+| `date_min` | string | Return sales for a specific start date, the date need to be in the YYYY-MM-DD format. |
+| `date_max` | string | Return 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
+GET /wp-json/wc/v1/reports/top_sellers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/reports/top_sellers?period=last_month \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("reports/top_sellers", {
+ period: "last_month",
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$query = [
+ 'period' => 'last_month'
+];
+
+print_r($woocommerce->get('reports/top_sellers', $query));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/top_sellers?period=last_month").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+query = {
+ period: "last_month"
+}
+
+woocommerce.get("reports/top_sellers", query).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Top sellers report properties
+| Attribute | Type | Description |
+|---------------------|---------|-----------------------------------------------------------------------|
+| `title` | string | Product title. `READ-ONLY` |
+| `product_id` | integer | Product ID. `READ-ONLY` |
+| `quantity` | integer | Total number of purchases. `READ-ONLY` |
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------|--------|-------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Default is `view`. Options: `view`. |
+| `period` | string | Report period. Default is `week`. Options: `week`, `month`, `last_month` and `year` |
+| `date_min` | string | Return sales for a specific start date, the date need to be in the YYYY-MM-DD format. |
+| `date_max` | string | Return sales for a specific end date, the date need to be in the YYYY-MM-DD format. |
diff --git a/docs/apis/rest-api/v1/tax-classes.mdx b/docs/apis/rest-api/v1/tax-classes.mdx
new file mode 100644
index 00000000000..ba3f26ecaf7
--- /dev/null
+++ b/docs/apis/rest-api/v1/tax-classes.mdx
@@ -0,0 +1,280 @@
+---
+sidebar_position: 18
+sidebar_label: 'Tax classes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Tax classes
+The tax classes API allows you to create, view, and delete individual tax classes.
+
+## Tax class properties
+| Attribute | Type | Description |
+|-----------|--------|-------------------------------------------------------------------------------|
+| `slug` | string | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Tax class name. `REQUIRED` |
+
+## Create a tax class
+This API helps you to create a new tax class.
+
+```http
+POST /wp-json/wc/v1/taxes/classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "Zero Rate"
+};
+
+WooCommerce.post("taxes/classes", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Zero Rate'
+];
+
+print_r($woocommerce->post('taxes/classes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Zero Rate"
+}
+
+print(wcapi.post("taxes/classes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Zero Rate"
+}
+
+woocommerce.post("taxes/classes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "slug": "zero-rate",
+ "name": "Zero Rate",
+ "_links": {
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v1/taxes/classes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all tax classes
+This API helps you to view all tax classes.
+
+```http
+GET /wp-json/wc/v1/taxes/classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/taxes/classes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("taxes/classes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes/classes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes/classes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes/classes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a tax class
+This API helps you delete a tax class.
+
+:::warning
+This also will delete all tax rates from the selected class.
+:::
+
+```http
+DELETE /wp-json/wc/v1/taxes/classes/<slug>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/taxes/classes/zero-rate?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("taxes/classes/zero-rate", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('taxes/classes/zero-rate', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("taxes/classes/zero-rate", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("taxes/classes/zero-rate", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "slug": "zero-rate",
+ "name": "Zero Rate",
+ "_links": {
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v1/taxes/classes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required to be `true`, since this resource does not support trashing. |
diff --git a/docs/apis/rest-api/v1/taxes.mdx b/docs/apis/rest-api/v1/taxes.mdx
new file mode 100644
index 00000000000..3be371b1ee7
--- /dev/null
+++ b/docs/apis/rest-api/v1/taxes.mdx
@@ -0,0 +1,4027 @@
+---
+sidebar_position: 17
+sidebar_label: 'Taxes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+|------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `country` | string | Country ISO 3166 code. See [ISO 3166 Codes (Countries)](http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html) for more details |
+| `state` | string | State code. |
+| `postcode` | string | Postcode/ZIP. |
+| `city` | string | City name. |
+| `rate` | string | Tax rate. |
+| `name` | string | Tax rate name. |
+| `priority` | integer | Tax 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`. |
+| `compound` | boolean | Whether or not this is a compound rate. Compound tax rates are applied on top of other tax rates. Default is `false`. |
+| `shipping` | boolean | Whether or not this tax rate also gets applied to shipping. Default is `true`. |
+| `order` | integer | Indicates the order that will appear in queries. |
+| `class` | string | Tax class. Default is `standard`. |
+
+## Create a tax rate
+This API helps you to create a new tax rate.
+
+```http
+POST /wp-json/wc/v1/taxes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'country' => 'US',
+ 'state' => 'AL',
+ 'rate' => '4',
+ 'name' => 'State Tax',
+ 'shipping' => false
+];
+
+print_r($woocommerce->post('taxes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "country": "US",
+ "state": "AL",
+ "rate": "4",
+ "name": "State Tax",
+ "shipping": False
+}
+
+print(wcapi.post("taxes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ country: "US",
+ state: "AL",
+ rate: "4",
+ name: "State Tax",
+ shipping: false
+}
+
+woocommerce.post("taxes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a tax rate
+This API lets you retrieve and view a specific tax rate by ID.
+
+```http
+GET /wp-json/wc/v1/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/taxes/72 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("taxes/72")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes/72')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes/72").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes/72").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all tax rates
+This API helps you to view all the tax rates.
+
+```http
+GET /wp-json/wc/v1/taxes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/taxes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("taxes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `name`. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. |
+| `class` | string | Sort by tax class. |
+
+## Update a tax rate
+This API lets you make changes to a tax rate.
+
+```http
+PUT /wp-json/wc/v1/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "US Tax"
+};
+
+WooCommerce.put("taxes/72", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'US Tax'
+];
+
+print_r($woocommerce->put('taxes/72', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "US Tax"
+}
+
+print(wcapi.put("taxes/72", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "US Tax"
+}
+
+woocommerce.put("taxes/72", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a tax rate
+This API helps you delete a tax rate.
+
+```http
+DELETE /wp-json/wc/v1/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/taxes/72?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("taxes/72", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('taxes/72', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("taxes/72", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("taxes/72", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/taxes/batch
+```
+
+> Example batch creating all US taxes:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v1/webhooks.mdx b/docs/apis/rest-api/v1/webhooks.mdx
new file mode 100644
index 00000000000..417330dedab
--- /dev/null
+++ b/docs/apis/rest-api/v1/webhooks.mdx
@@ -0,0 +1,1155 @@
+---
+sidebar_position: 19
+sidebar_label: 'Webhooks'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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-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](https://docs.woocommerce.com/document/webhooks/) for more details.
+
+## Webhook properties
+| Attribute | Type | Description |
+|-----------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | A friendly name for the webhook. Default is `Webhook created on <date>`. |
+| `status` | string | Webhook status. Default is `active`. Options `active` (delivers payload), `paused` (does not deliver), or `disabled` (does not deliver due delivery failures). |
+| `topic` | string | Webhook topic, e.g. `coupon.updated`. [See the complete list](#topics). `REQUIRED` |
+| `resource` | string | Webhook resource, e.g. `coupon` `READ-ONLY` |
+| `event` | string | Webhook event, e.g. `updated` `READ-ONLY` |
+| `hooks` | array | WooCommerce action names associated with the webhook. `READ-ONLY` |
+| `delivery_url` | string | The URL where the webhook payload is delivered. `REQUIRED` |
+| `secret` | string | Secret key used to generate a hash of the delivered webhook and provided in the request headers. `REQUIRED` `WRITE-ONLY` |
+| `date_created` | date-time | UTC DateTime when the webhook was created `READ-ONLY` |
+| `date_modified` | date-time | UTC DateTime when the webhook was last updated `READ-ONLY` |
+
+### Webhooks delivery properties
+| Attribute | Type | Description |
+|--------------------|-----------|--------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `duration` | string | The delivery duration, in seconds. `READ-ONLY` |
+| `summary` | string | A friendly summary of the response including the HTTP response code, message, and body. `READ-ONLY` |
+| `request_url` | string | The URL where the webhook was delivered. `READ-ONLY` |
+| `request_headers` | object | Request headers. See [Request Headers Attributes](#request-header-properties) for more details. `READ-ONLY` |
+| `request_body` | string | Request body. `READ-ONLY` |
+| `response_code` | string | The HTTP response code from the receiving server. `READ-ONLY` |
+| `response_message` | string | The HTTP response message from the receiving server. `READ-ONLY` |
+| `response_headers` | object | Response headers from the receiving server. `READ-ONLY` |
+| `response_body` | string | The response body from the receiving server. `READ-ONLY` |
+| `date_created` | date-time | The date the webhook delivery was logged, in the site's timezone. `READ-ONLY` |
+
+#### Request header properties
+| Attribute | Type | Description |
+|----------------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------|
+| `User-Agent` | string | The request user agent, default is "WooCommerce/\{version\} Hookshot (WordPress/\{version\})". `READ-ONLY` |
+| `Content-Type` | string | The request content-type, default is "application/json". `READ-ONLY` |
+| `X-WC-Webhook-Source` | string | The webhook source URL. `READ-ONLY` |
+| `X-WC-Webhook-Topic` | string | The webhook topic. `READ-ONLY` |
+| `X-WC-Webhook-Resource` | string | The webhook resource. `READ-ONLY` |
+| `X-WC-Webhook-Event` | string | The webhook event. `READ-ONLY` |
+| `X-WC-Webhook-Signature` | string | A base64 encoded HMAC-SHA256 hash of the payload. `READ-ONLY` |
+| `X-WC-Webhook-ID` | integer | The webhook's ID. `READ-ONLY` |
+| `X-WC-Webhook-Delivery-ID` | integer | The delivery ID. `READ-ONLY` |
+
+## Create a webhook
+This API helps you to create a new webhook.
+
+```http
+POST /wp-json/wc/v1/webhooks
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Order updated',
+ 'topic' => 'order.updated',
+ 'delivery_url' => 'http://requestb.in/1g0sxmo1'
+];
+
+print_r($woocommerce->post('webhooks', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Order updated",
+ "topic": "order.updated",
+ "delivery_url": "http://requestb.in/1g0sxmo1"
+}
+
+print(wcapi.post("webhooks", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Order updated",
+ topic: "order.updated",
+ delivery_url: "http://requestb.in/1g0sxmo1"
+}
+
+woocommerce.post("webhooks", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a webhook
+This API lets you retrieve and view a specific webhook.
+
+```http
+GET /wp-json/wc/v1/webhooks/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/webhooks/142 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("webhooks/142")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks/142')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks/142").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks/142").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all webhooks
+This API helps you to view all the webhooks.
+
+```http
+GET /wp-json/wc/v1/webhooks
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/webhooks \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("webhooks")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------------|---------|-------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | string | Ensure result set excludes specific ids. |
+| `include` | string | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `date`, Options: `date`, `id`, `include`, `title` and `slug`. |
+| `slug` | string | Limit result set to posts with a specific slug. |
+| `status` | string | Limit 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
+PUT /wp-json/wc/v1/webhooks/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X PUT https://example.com/wp-json/wc/v1/webhooks/142 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "status": "paused"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ status: "paused"
+}
+
+WooCommerce.put("webhooks/142", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'status' => 'paused'
+];
+
+print_r($woocommerce->put('webhooks/142', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "status": "paused"
+}
+
+print(wcapi.put("webhooks/142", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ status: "paused"
+}
+
+woocommerce.put("webhooks/142", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a webhook
+This API helps you delete a webhook.
+
+```http
+DELETE /wp-json/wc/v1/webhooks/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v1/webhooks/142 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("webhooks/142")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('webhooks/142')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("webhooks/142").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("webhooks/142").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|----------------------------------------------------------------------------|
+| `force` | boolean | Whether to permanently delete the webhook. Default is `false`. |
+
+## Batch update webhooks
+This API helps you to batch create, update and delete multiple webhooks.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v1/webhooks/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve webhook delivery
+This API lets you retrieve and view a specific webhook delivery.
+
+```http
+GET /wp-json/wc/v1/webhooks/<id>/deliveries/<delivery_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/webhooks/142/deliveries/54 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("webhooks/142/deliveries/54")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks/142/deliveries/54')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks/142/deliveries/54").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks/142/deliveries/54").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+:::note
+View the <a href="#webhooks-delivery-properties">Webhooks Delivery properties</a> for more details on this response.
+:::
+
+## List all webhook deliveries
+This API helps you view all deliveries from a specific webhook.
+
+```http
+GET /wp-json/wc/v1/webhooks/<id>/deliveries
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v1/webhooks/142/deliveries \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("webhooks/142/deliveries")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks/142/deliveries')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks/142/deliveries").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks/142/deliveries").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/_category_.json b/docs/apis/rest-api/v2/_category_.json
new file mode 100644
index 00000000000..b896ecba8f8
--- /dev/null
+++ b/docs/apis/rest-api/v2/_category_.json
@@ -0,0 +1,4 @@
+{
+ "label": "v2",
+ "position": 4
+}
diff --git a/docs/apis/rest-api/v2/coupons.mdx b/docs/apis/rest-api/v2/coupons.mdx
new file mode 100644
index 00000000000..f73c7e0235d
--- /dev/null
+++ b/docs/apis/rest-api/v2/coupons.mdx
@@ -0,0 +1,1065 @@
+---
+sidebar_position: 4
+sidebar_label: 'Coupons'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Coupons
+The coupons API allows you to create, view, update, and delete individual, or a batch, of coupon codes.
+
+## Coupon properties
+| Attribute | Type | Description |
+| ----------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------ |
+| `id` | integer | Unique identifier for the object. `READ-ONLY` |
+| `code` | string | Coupon code. `MANDATORY` |
+| `amount` | string | The amount of discount. Should always be numeric, even if setting a percentage. |
+| `date_created` | date-time | The date the coupon was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the coupon was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the coupon was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the coupon was last modified, as GMT. `READ-ONLY` |
+| `discount_type` | string | Determines the type of discount that will be applied. Options: `percent`, `fixed_cart` and `fixed_product`. Default is `fixed_cart`. |
+| `description` | string | Coupon description. |
+| `date_expires` | string | The date the coupon expires, in the site's timezone. |
+| `date_expires_gmt` | string | The date the coupon expires, as GMT. |
+| `usage_count` | integer | Number of times the coupon has been used already. `READ-ONLY` |
+| `individual_use` | boolean | If true, the coupon can only be used individually. Other applied coupons will be removed from the cart. Default is `false`. |
+| `product_ids` | array | List of product IDs the coupon can be used on. |
+| `excluded_product_ids` | array | List of product IDs the coupon cannot be used on. |
+| `usage_limit` | integer | How many times the coupon can be used in total. |
+| `usage_limit_per_user` | integer | How many times the coupon can be used per customer. |
+| `limit_usage_to_x_items` | integer | Max number of items in the cart the coupon can be applied to. |
+| `free_shipping` | boolean | If true and if the free shipping method requires a coupon, this coupon will enable free shipping. Default is `false`. |
+| `product_categories` | array | List of category IDs the coupon applies to. |
+| `excluded_product_categories` | array | List of category IDs the coupon does not apply to. |
+| `exclude_sale_items` | boolean | If true, this coupon will not be applied to items that have sale prices. Default is `false`. |
+| `minimum_amount` | string | Minimum order amount that needs to be in the cart before coupon applies. |
+| `maximum_amount` | string | Maximum order amount allowed when using the coupon. |
+| `email_restrictions` | array | List of email addresses that can use this coupon. |
+| `used_by` | array | List of user IDs (or guest email addresses) that have used the coupon. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Coupon - Meta data properties](#coupon---meta-data-properties) |
+
+### Coupon - Meta data properties
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+## Create a coupon
+This API helps you to create a new coupon.
+
+```http
+POST /wp-json/wc/v2/coupons
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a coupon
+This API lets you retrieve and view a specific coupon by ID.
+
+```http
+GET /wp-json/wc/v2/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/coupons/719 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("coupons/719")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('coupons/719')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("coupons/719").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("coupons/719").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all coupons
+This API helps you to list all the coupons that have been created.
+
+```http
+GET /wp-json/wc/v2/coupons
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/coupons \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("coupons")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('coupons')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("coupons").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("coupons").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| --------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `code` | string | Limit result set to resources with a specific code. |
+
+## Update a coupon
+This API lets you make changes to a coupon.
+
+```http
+PUT /wp-json/wc/v2/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ amount: "5"
+};
+
+WooCommerce.put("coupons/719", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'amount' => '5'
+];
+
+print_r($woocommerce->put('coupons/719', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "amount": "5"
+}
+
+print(wcapi.put("coupons/719", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ amount: "5"
+}
+
+woocommerce.put("coupons/719", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a coupon
+This API helps you delete a coupon.
+
+```http
+DELETE /wp-json/wc/v2/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/coupons/719?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("coupons/719", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('coupons/719', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("coupons/719", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("coupons/719", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|--------------------------------------------------------------------------|
+| `force` | boolean | Use `true` to permanently delete the coupon. Default is `false`. |
+
+## Batch update coupons
+This API helps you to batch create, update and delete multiple coupons.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/coupons/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/customers.mdx b/docs/apis/rest-api/v2/customers.mdx
new file mode 100644
index 00000000000..d3738934ba8
--- /dev/null
+++ b/docs/apis/rest-api/v2/customers.mdx
@@ -0,0 +1,1687 @@
+---
+sidebar_position: 5
+sidebar_label: 'Customers'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Customers
+The customer API allows you to create, view, update, and delete individual, or a batch, of customers.
+
+## Customer properties
+| Attribute | Type | Description |
+| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the customer was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the customer was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the customer was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the customer was last modified, as GMT. `READ-ONLY` |
+| `email` | string | The email address for the customer. `MANDATORY` |
+| `first_name` | string | Customer first name. |
+| `last_name` | string | Customer last name. |
+| `role` | string | Customer role. `READ-ONLY` |
+| `username` | string | Customer login name. |
+| `password` | string | Customer password. `WRITE-ONLY` |
+| `billing` | object | List of billing address data. See [Customer - Billing properties](#customer---billing-properties) |
+| `shipping` | object | List of shipping address data. See [Customer - Shipping properties](#customer---shipping-properties) |
+| `is_paying_customer` | bool | Is the customer a paying customer? `READ-ONLY` |
+| `orders_count` | integer | Quantity of orders made by the customer. `READ-ONLY` |
+| `total_spent` | string | Total amount spent. `READ-ONLY` |
+| `avatar_url` | string | Avatar URL. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Customer - Meta data properties](#customer---meta-data-properties) |
+
+### Customer - Billing properties
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1 |
+| `address_2` | string | Address line 2 |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | ISO code of the country. |
+| `email` | string | Email address. |
+| `phone` | string | Phone number. |
+
+### Customer - Shipping properties
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1 |
+| `address_2` | string | Address line 2 |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | ISO code of the country. |
+
+### Customer - Meta data properties
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+## Create a customer
+This API helps you to create a new customer.
+
+```http
+POST /wp-json/wc/v2/customers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a customer
+This API lets you retrieve and view a specific customer by ID.
+
+```http
+GET /wp-json/wc/v2/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/customers/25 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("customers/25")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers/25')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers/25").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers/25").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all customers
+This API helps you to view all the customers.
+
+```http
+GET /wp-json/wc/v2/customers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/customers \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("customers")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific IDs. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `id`, `include`, `name` and `registered_date`. Default is `name`. |
+| `email` | string | Limit result set to resources with a specific email. |
+| `role` | string | Limit 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
+PUT /wp-json/wc/v2/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'first_name' => 'James',
+ 'billing' => [
+ 'first_name' => 'James'
+ ],
+ 'shipping' => [
+ 'first_name' => 'James'
+ ]
+];
+
+print_r($woocommerce->put('customers/25', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "first_name": "James",
+ "billing": {
+ "first_name": "James"
+ },
+ "shipping": {
+ "first_name": "James"
+ }
+}
+
+print(wcapi.put("customers/25", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ first_name: "James",
+ billing: {
+ first_name: "James"
+ },
+ shipping: {
+ first_name: "James"
+ }
+}
+
+woocommerce.put("customers/25", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a customer
+This API helps you delete a customer.
+
+```http
+DELETE /wp-json/wc/v2/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/customers/25?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("customers/25", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('customers/25', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("customers/25", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("customers/25", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------|---------|---------------------------------------------------------------|
+| `force` | boolean | Required to be `true`, as resource does not support trashing. |
+| `reassign` | integer | User ID to reassign posts to. |
+
+## Batch update customers
+This API helps you to batch create, update and delete multiple customers.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/customers/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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: [
+ 25
+ ]
+};
+
+WooCommerce.post("customers/batch", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve customer downloads
+This API lets you retrieve customer downloads permissions.
+
+```http
+GET /wp-json/wc/v2/customers/<id>/downloads
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/customers/26/downloads \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("customers/26/downloads")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers/26/downloads')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers/26/downloads").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers/26/downloads").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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 – 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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+### Customer downloads properties
+| Attribute | Type | Description |
+| --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
+| `download_id` | string | Download ID (MD5). `READ-ONLY` |
+| `download_url` | string | Download file URL. `READ-ONLY` |
+| `product_id` | integer | Downloadable product ID. `READ-ONLY` |
+| `product_name` | string | Product name. `READ-ONLY` |
+| `download_name` | string | Downloadable file name. `READ-ONLY` |
+| `order_id` | integer | Order ID. `READ-ONLY` |
+| `order_key` | string | Order key. `READ-ONLY` |
+| `downloads_remaining` | string | Number of downloads remaining. `READ-ONLY` |
+| `access_expires` | string | The date when download access expires, in the site's timezone. `READ-ONLY` |
+| `access_expires_gmt` | string | The date when download access expires, as GMT. `READ-ONLY` |
+| `file` | object | File details. `READ-ONLY` See [Customers downloads - File properties](#customer-downloads---file-properties) |
+
+### Customer downloads - File properties
+| Attribute | Type | Description |
+| --------- | ------ | ---------------------------------------------------- |
+| `name` | string | File name. `READ-ONLY` |
+| `file` | string | File URL. `READ-ONLY` |
diff --git a/docs/apis/rest-api/v2/images/woocommerce-api-key-generated.png b/docs/apis/rest-api/v2/images/woocommerce-api-key-generated.png
new file mode 100644
index 00000000000..705d505d3ef
Binary files /dev/null and b/docs/apis/rest-api/v2/images/woocommerce-api-key-generated.png differ
diff --git a/docs/apis/rest-api/v2/images/woocommerce-api-keys-settings.png b/docs/apis/rest-api/v2/images/woocommerce-api-keys-settings.png
new file mode 100644
index 00000000000..51ff26b433e
Binary files /dev/null and b/docs/apis/rest-api/v2/images/woocommerce-api-keys-settings.png differ
diff --git a/docs/apis/rest-api/v2/images/woocommerce-auth-endpoint-example.png b/docs/apis/rest-api/v2/images/woocommerce-auth-endpoint-example.png
new file mode 100644
index 00000000000..d10d2413952
Binary files /dev/null and b/docs/apis/rest-api/v2/images/woocommerce-auth-endpoint-example.png differ
diff --git a/docs/apis/rest-api/v2/images/woocommerce-auth-endpoint-flow.png b/docs/apis/rest-api/v2/images/woocommerce-auth-endpoint-flow.png
new file mode 100644
index 00000000000..82907e81a84
Binary files /dev/null and b/docs/apis/rest-api/v2/images/woocommerce-auth-endpoint-flow.png differ
diff --git a/docs/apis/rest-api/v2/images/woocommerce-creating-api-keys.png b/docs/apis/rest-api/v2/images/woocommerce-creating-api-keys.png
new file mode 100644
index 00000000000..aa06315fe6d
Binary files /dev/null and b/docs/apis/rest-api/v2/images/woocommerce-creating-api-keys.png differ
diff --git a/docs/apis/rest-api/v2/index.mdx b/docs/apis/rest-api/v2/index.mdx
new file mode 100644
index 00000000000..06d895dfa72
--- /dev/null
+++ b/docs/apis/rest-api/v2/index.mdx
@@ -0,0 +1,11 @@
+---
+title: REST API v2
+slug: /apis/rest-api/v2
+sidebar_position: 0
+---
+
+import DocCardList from '@theme/DocCardList';
+
+Legacy version of the WooCommerce REST API. Use `/wp-json/wc/v2/` endpoints. Consider migrating to v3 for new integrations.
+
+<DocCardList />
diff --git a/docs/apis/rest-api/v2/order-notes.mdx b/docs/apis/rest-api/v2/order-notes.mdx
new file mode 100644
index 00000000000..54fa626a807
--- /dev/null
+++ b/docs/apis/rest-api/v2/order-notes.mdx
@@ -0,0 +1,432 @@
+---
+sidebar_position: 7
+sidebar_label: 'Order notes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the order note was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the order note was created, as GMT. `READ-ONLY` |
+| `note` | string | Order note content. `MANDATORY` |
+| `customer_note` | boolean | If 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
+POST /wp-json/wc/v2/orders/<id>/notes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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!!!"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ note: "Order ok!!!"
+};
+
+WooCommerce.post("orders/723/notes", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'note' => 'Order ok!!!'
+];
+
+print_r($woocommerce->post('orders/723/notes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "note": "Order ok!!!"
+}
+
+print(wcapi.post("orders/723/notes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ note: "Order ok!!!"
+}
+
+woocommerce.post("orders/723/notes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an order note
+This API lets you retrieve and view a specific note from an order.
+
+```http
+GET /wp-json/wc/v2/orders/<id>/notes/<note_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/orders/723/notes/281 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/723/notes/281")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/723/notes/281')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/notes/281").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/723/notes/281").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all order notes
+This API helps you to view all the notes from an order.
+
+```http
+GET /wp-json/wc/v2/orders/<id>/notes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/orders/723/notes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/723/notes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/723/notes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/notes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/723/notes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `type` | string | Limit 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
+DELETE /wp-json/wc/v2/orders/<id>/notes/<note_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/orders/723/notes/281?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("orders/723/notes/281", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/723/notes/281', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/723/notes/281", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/723/notes/281", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v2/order-refunds.mdx b/docs/apis/rest-api/v2/order-refunds.mdx
new file mode 100644
index 00000000000..80e775c75d7
--- /dev/null
+++ b/docs/apis/rest-api/v2/order-refunds.mdx
@@ -0,0 +1,497 @@
+---
+sidebar_position: 8
+sidebar_label: 'Order refunds'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Refunds
+The refunds API allows you to create, view, and delete individual refunds.
+
+## Order refund properties
+| Attribute | Type | Description |
+|--------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the order refund was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the order refund was created, as GMT. `READ-ONLY` |
+| `amount` | string | Refund amount. |
+| `reason` | string | Reason for refund. |
+| `refunded_by` | integer | User ID of user who created the refund. |
+| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund---meta-data-properties) |
+| `line_items` | array | Line items data. See [Order refund - Line items properties](#order-refund---line-items-properties) |
+| `api_refund` | boolean | When true, the payment gateway API is used to generate the refund. Default is `true`. `WRITE-ONLY` |
+
+### Order refund - Meta data properties
+| Attribute | Type | Description |
+|-----------|---------|----------------------------------------------------|
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+### Order refund - Line items properties
+| Attribute | Type | Description |
+|----------------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Product name. |
+| `product_id` | integer | Product ID. |
+| `variation_id` | integer | Variation ID, if applicable. |
+| `quantity` | integer | Quantity ordered. |
+| `tax_class` | string | Tax class of product. |
+| `subtotal` | string | Line subtotal (before discounts). |
+| `subtotal_tax` | string | Line subtotal tax (before discounts). `READ-ONLY` |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order refund line item - Taxes properties](#order-refund-line-item---taxes-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund---meta-data-properties) |
+| `sku` | string | Product SKU. `READ-ONLY` |
+| `price` | string | Product price. `READ-ONLY` |
+
+#### Order refund line item - Taxes properties
+| Attribute | Type | Description |
+|------------|---------|---------------------------------------------------------|
+| `id` | integer | Tax rate ID. `READ-ONLY` |
+| `total` | string | Tax total. `READ-ONLY` |
+| `subtotal` | string | Tax subtotal. `READ-ONLY` |
+
+## Create a refund
+This API helps you to create a new refund for an order.
+
+```http
+POST /wp-json/wc/v2/orders/<id>/refunds
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ amount: "10"
+};
+
+WooCommerce.post("orders/723/refunds", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'amount' => '10'
+];
+
+print_r($woocommerce->post('orders/723/refunds', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "amount": "10"
+}
+
+print(wcapi.post("orders/723/refunds", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ amount: "10"
+}
+
+woocommerce.post("orders/723/refunds", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a refund
+This API lets you retrieve and view a specific refund from an order.
+
+```http
+GET /wp-json/wc/v2/orders/<id>/refunds/<refund_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/orders/723/refunds/726 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/723/refunds/726")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/723/refunds/726')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/refunds/726").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/723/refunds/726").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------|
+| `dp` | integer | Number of decimal points to use in each resource. |
+
+## List all refunds
+This API helps you to view all the refunds from an order.
+
+```http
+GET /wp-json/wc/v2/orders/<id>/refunds
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/orders/723/refunds \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/723/refunds")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/723/refunds')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/refunds").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/723/refunds").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------------|---------|------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `dp` | integer | Number of decimal points to use in each resource. Default is `2`. |
+
+## Delete a refund
+This API helps you delete an order refund.
+
+```http
+DELETE /wp-json/wc/v2/orders/<id>/refunds/<refund_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/orders/723/refunds/726?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("orders/723/refunds/726", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/723/refunds/726', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/723/refunds/726", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/723/refunds/726", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | boolean | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v2/orders.mdx b/docs/apis/rest-api/v2/orders.mdx
new file mode 100644
index 00000000000..fab4c38eed1
--- /dev/null
+++ b/docs/apis/rest-api/v2/orders.mdx
@@ -0,0 +1,2990 @@
+---
+sidebar_position: 6
+sidebar_label: 'Orders'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Orders
+The orders API allows you to create, view, update, and delete individual, or a batch, of orders.
+
+## Order properties
+| Attribute | Type | Description |
+|------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `parent_id` | integer | Parent order ID. |
+| `number` | string | Order number. `READ-ONLY` |
+| `order_key` | string | Order key. `READ-ONLY` |
+| `created_via` | string | Shows where the order was created. `READ-ONLY` |
+| `version` | string | Version of WooCommerce which last updated the order. `READ-ONLY` |
+| `status` | string | Order status. Options: `pending`, `processing`, `on-hold`, `completed`, `cancelled`, `refunded`, `failed` and `trash`. Default is `pending`. |
+| `currency` | string | Currency 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_created` | date-time | The date the order was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the order was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the order was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the order was last modified, as GMT. `READ-ONLY` |
+| `discount_total` | string | Total discount amount for the order. `READ-ONLY` |
+| `discount_tax` | string | Total discount tax amount for the order. `READ-ONLY` |
+| `shipping_total` | string | Total shipping amount for the order. `READ-ONLY` |
+| `shipping_tax` | string | Total shipping tax amount for the order. `READ-ONLY` |
+| `cart_tax` | string | Sum of line item taxes only. `READ-ONLY` |
+| `total` | string | Grand total. `READ-ONLY` |
+| `total_tax` | string | Sum of all taxes. `READ-ONLY` |
+| `prices_include_tax` | boolean | True the prices included tax during checkout. `READ-ONLY` |
+| `customer_id` | integer | User ID who owns the order. 0 for guests. Default is `0`. |
+| `customer_ip_address` | string | Customer's IP address. `READ-ONLY` |
+| `customer_user_agent` | string | User agent of the customer. `READ-ONLY` |
+| `customer_note` | string | Note left by customer during checkout. |
+| `billing` | object | Billing address. See [Order - Billing properties](#order---billing-properties) |
+| `shipping` | object | Shipping address. See [Order - Shipping properties](#order---shipping-properties) |
+| `payment_method` | string | Payment method ID. |
+| `payment_method_title` | string | Payment method title. |
+| `transaction_id` | string | Unique transaction ID. |
+| `date_paid` | date-time | The date the order was paid, in the site's timezone. `READ-ONLY` |
+| `date_paid_gmt` | date-time | The date the order was paid, as GMT. `READ-ONLY` |
+| `date_completed` | date-time | The date the order was completed, in the site's timezone. `READ-ONLY` |
+| `date_completed_gmt` | date-time | The date the order was completed, as GMT. `READ-ONLY` |
+| `cart_hash` | string | MD5 hash of cart items to ensure orders are not modified. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+| `line_items` | array | Line items data. See [Order - Line items properties](#order---line-items-properties) |
+| `tax_lines` | array | Tax lines data. See [Order - Tax lines properties](#order---tax-lines-properties) `READ-ONLY` |
+| `shipping_lines` | array | Shipping lines data. See [Order - Shipping lines properties](#order---shipping-lines-properties) |
+| `fee_lines` | array | Fee lines data. See [Order - Fee lines properties](#order---fee-lines-properties) |
+| `coupon_lines` | array | Coupons line data. See [Order - Coupon lines properties](#order---coupon-lines-properties) |
+| `refunds` | array | List of refunds. See [Order - Refunds properties](#order---refunds-properties) `READ-ONLY` |
+| `set_paid` | boolean | Define if the order is paid. It will set the status to processing and reduce stock items. Default is `false`. `WRITE-ONLY` |
+
+### Order - Billing properties
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1 |
+| `address_2` | string | Address line 2 |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | Country code in ISO 3166-1 alpha-2 format. |
+| `email` | string | Email address. |
+| `phone` | string | Phone number. |
+
+### Order - Shipping properties
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1 |
+| `address_2` | string | Address line 2 |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | Country code in ISO 3166-1 alpha-2 format. |
+
+### Order - Meta data properties
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+### Order - Line items properties
+| Attribute | Type | Description |
+| -------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Product name. |
+| `product_id` | integer | Product ID. |
+| `variation_id` | integer | Variation ID, if applicable. |
+| `quantity` | integer | Quantity ordered. |
+| `tax_class` | integer | Tax class of product. |
+| `subtotal` | string | Line subtotal (before discounts). |
+| `subtotal_tax` | string | Line subtotal tax (before discounts). `READ-ONLY` |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order - Taxes properties](#order---taxes-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+| `sku` | string | Product SKU. `READ-ONLY` |
+| `price` | string | Product price. `READ-ONLY` |
+
+### Order - Tax lines properties
+| Attribute | Type | Description |
+| -------------------- | ------- | ----------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `rate_code` | string | Tax rate code. `READ-ONLY` |
+| `rate_id` | string | Tax rate ID. `READ-ONLY` |
+| `label` | string | Tax rate label. `READ-ONLY` |
+| `compound` | boolean | Show if is a compound tax rate. `READ-ONLY` |
+| `tax_total` | string | Tax total (not including shipping taxes). `READ-ONLY` |
+| `shipping_tax_total` | string | Shipping tax total. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+### Order - Shipping lines properties
+| Attribute | Type | Description |
+| -------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `method_title` | string | Shipping method name. |
+| `method_id` | string | Shipping method ID. |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order - Taxes properties](#order---taxes-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+### Order - Fee lines properties
+| Attribute | Type | Description |
+| ------------ | ------- | ------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Fee name. |
+| `tax_class` | string | Tax class of fee. |
+| `tax_status` | string | Tax status of fee. Options: `taxable` and `none`. |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order - Taxes properties](#order---taxes-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+### Order - Coupon lines properties
+| Attribute | Type | Description |
+| -------------- | ------- | -------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `code` | string | Coupon code. |
+| `discount` | string | Discount total. |
+| `discount_tax` | string | Discount total tax. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+### Order - Refunds properties
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------------- |
+| `id` | integer | Refund ID. `READ-ONLY` |
+| `reason` | string | Refund reason. `READ-ONLY` |
+| `total` | string | Refund total. `READ-ONLY` |
+
+### Order - Taxes properties
+| Attribute | Type | Description |
+|----------------------|---------|-------------------------------------------------------------------------------------|
+| `id` | integer | Item ID. `READ-ONLY` |
+| `rate_code` | string | Tax rate code. `READ-ONLY` |
+| `rate_id` | string | Tax rate ID. `READ-ONLY` |
+| `label` | string | Tax rate label. `READ-ONLY` |
+| `compound` | boolean | Show if is a compound tax rate. `READ-ONLY` |
+| `tax_total` | string | Tax total (not including shipping taxes). `READ-ONLY` |
+| `shipping_tax_total` | string | Shipping tax total. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+## Create an order
+This API helps you to create a new order.
+
+```http
+POST /wp-json/wc/v2/orders
+```
+
+> Example of create a paid order:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an order
+This API lets you retrieve and view a specific order.
+
+```http
+GET /wp-json/wc/v2/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/orders/727 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders/727")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/727')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/727").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/727").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------|
+| `dp` | string | Number of decimal points to use in each resource. |
+
+## List all orders
+This API helps you to view all the orders.
+
+```http
+GET /wp-json/wc/v2/orders
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/orders \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("orders")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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 – 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 × 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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `status` | string | Limit result set to orders assigned a specific status. Options: `any`, `pending`, `processing`, `on-hold`, `completed`, `cancelled`, `refunded` and `failed`. Default is `any`. |
+| `customer` | integer | Limit result set to orders assigned a specific customer. |
+| `product` | integer | Limit result set to orders assigned a specific product. |
+| `dp` | integer | Number 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
+```http
+PUT /wp-json/wc/v2/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ status: "completed"
+};
+
+WooCommerce.put("orders/727", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'status' => 'completed'
+];
+
+print_r($woocommerce->put('orders/727', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "status": "completed"
+}
+
+print(wcapi.put("orders/727", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ status: "completed"
+}
+
+woocommerce.put("orders/727", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete an order
+This API helps you delete an order.
+
+```http
+DELETE /wp-json/wc/v2/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/orders/727?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("orders/727", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/727', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/727", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/727", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|-------------------------------------------------------------------------|
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/orders/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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 – 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 – 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 – 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 × 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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/payment-gateways.mdx b/docs/apis/rest-api/v2/payment-gateways.mdx
new file mode 100644
index 00000000000..00e54418c22
--- /dev/null
+++ b/docs/apis/rest-api/v2/payment-gateways.mdx
@@ -0,0 +1,649 @@
+---
+sidebar_position: 20
+sidebar_label: 'Payment gateways'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------- |
+| `id` | string | Payment gateway ID. `READ-ONLY` |
+| `title` | string | Payment gateway title on checkout. |
+| `description` | string | Payment gateway description on checkout. |
+| `order` | integer | Payment gateway sort order. |
+| `enabled` | boolean | Payment gateway enabled status. |
+| `method_title` | string | Payment gateway method title. `READ-ONLY` |
+| `method_description` | string | Payment gateway method description. `READ-ONLY` |
+| `settings` | object | Payment gateway settings. See [Payment gateway - Settings properties](#payment-gateway---settings-properties) |
+
+### Payment gateway - Settings properties
+| Attribute | Type | Description |
+| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier for the setting. `READ-ONLY` |
+| `label` | string | A human readable label for the setting used in interfaces. `READ-ONLY` |
+| `description` | string | A human readable description for the setting used in interfaces. `READ-ONLY` |
+| `type` | string | Type of setting. Options: `text`, `email`, `number`, `color`, `password`, `textarea`, `select`, `multiselect`, `radio`, `image_width` and `checkbox`. `READ-ONLY` |
+| `value` | string | Setting value. |
+| `default` | string | Default value for the setting. `READ-ONLY` |
+| `tip` | string | Additional help text shown to the user about the setting. `READ-ONLY` |
+| `placeholder` | string | Placeholder text to be displayed in text inputs. `READ-ONLY` |
+
+## Retrieve a payment gateway
+This API lets you retrieve and view a specific payment gateway.
+
+```http
+GET /wp-json/wc/v2/payment_gateways/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/payment_gateways/bacs \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("payment_gateways/bacs")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('payment_gateways/bacs')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("payment_gateways/bacs").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("payment_gateways/bacs").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all payment gateways
+This API helps you to view all the payment gateways.
+
+```http
+GET /wp-json/wc/v2/payment_gateways
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/payment_gateways \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("payment_gateways")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('payment_gateways')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("payment_gateways").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("payment_gateways").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a payment gateway
+This API lets you make changes to a payment gateway.
+
+```http
+PUT /wp-json/wc/v2/payment_gateways/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ enabled: false
+};
+
+WooCommerce.put("payment_gateways/bacs", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'enabled' => false
+];
+
+print_r($woocommerce->put('payment_gateways/bacs', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "enabled": False
+}
+
+print(wcapi.put("payment_gateways/bacs", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ enabled: false
+}
+
+woocommerce.put("payment_gateways/bacs", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/product-attribute-terms.mdx b/docs/apis/rest-api/v2/product-attribute-terms.mdx
new file mode 100644
index 00000000000..26f8eb1c253
--- /dev/null
+++ b/docs/apis/rest-api/v2/product-attribute-terms.mdx
@@ -0,0 +1,876 @@
+---
+sidebar_position: 12
+sidebar_label: 'Product attribute terms'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+| ------------- | ------- | ---------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Term name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `menu_order` | integer | Menu order, used to custom sort the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create an attribute term
+This API helps you to create a new product attribute term.
+
+```http
+POST /wp-json/wc/v2/products/attributes/<attribute_id>/terms
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "XXS"
+};
+
+WooCommerce.post("products/attributes/2/terms", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'XXS'
+];
+
+print_r($woocommerce->post('products/attributes/2/terms', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "XXS"
+}
+
+print(wcapi.post("products/attributes/2/terms", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "XXS"
+}
+
+woocommerce.post("products/attributes/2/terms", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an attribute term
+This API lets you retrieve a product attribute term by ID.
+
+```http
+GET /wp-json/wc/v2/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/attributes/2/terms/23 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/attributes/2/terms/23")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/2/terms/23')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/2/terms/23").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/2/terms/23").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all attribute terms
+This API lets you retrieve all terms from a product attribute.
+
+```http
+GET /wp-json/wc/v2/products/attributes/<attribute_id>/terms
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/attributes/2/terms \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/attributes/2/terms")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/2/terms')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/2/terms").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/2/terms").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| -------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. Default is `name`. |
+| `hide_empty` | boolean | Whether to hide resources not assigned to any products. Default is `false`. |
+| `parent` | integer | Limit result set to resources assigned to a specific parent. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update an attribute term
+This API lets you make changes to a product attribute term.
+
+```http
+PUT /wp-json/wc/v2/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'XXS'
+];
+
+print_r($woocommerce->put('products/attributes/2/terms/23', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "XXS"
+}
+
+print(wcapi.put("products/attributes/2/terms/23", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "XXS"
+}
+
+woocommerce.put("products/attributes/2/terms/23", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete an attribute term
+This API helps you delete a product attribute term.
+
+```http
+DELETE /wp-json/wc/v2/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/products/attributes/2/terms/23?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/attributes/2/terms/23", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/attributes/2/terms/23', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/attributes/2/terms/23", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/attributes/2/terms/23", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|---------|---------------------------------------------------------------|
+| `force` | boolean | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/products/attributes/<attribute_id>/terms/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X POST https://example.com/wp-json/wc/v2/products/attributes/<attribute_id>/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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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": 6,
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/product-attributes.mdx b/docs/apis/rest-api/v2/product-attributes.mdx
new file mode 100644
index 00000000000..f8f32802955
--- /dev/null
+++ b/docs/apis/rest-api/v2/product-attributes.mdx
@@ -0,0 +1,764 @@
+---
+sidebar_position: 11
+sidebar_label: 'Product attributes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product attributes
+The product attributes API allows you to create, view, update, and delete individual, or a batch, of product attributes.
+
+## Product attribute properties
+| Attribute | Type | Description |
+| -------------- | ------- | ------------------------------------------------------------------------------------------------ |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Attribute name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `type` | string | Type of attribute. By default only `select` is supported. |
+| `order_by` | string | Default sort order. Options: `menu_order`, `name`, `name_num` and `id`. Default is `menu_order`. |
+| `has_archives` | boolean | Enable/Disable attribute archives. Default is `false`. |
+
+## Create a product attribute
+This API helps you to create a new product attribute.
+
+```http
+POST /wp-json/wc/v2/products/attributes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Color',
+ 'slug' => 'pa_color',
+ 'type' => 'select',
+ 'order_by' => 'menu_order',
+ 'has_archives' => true
+];
+
+print_r($woocommerce->post('products/attributes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": True
+}
+
+print(wcapi.post("products/attributes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Color",
+ slug: "pa_color",
+ type: "select",
+ order_by: "menu_order",
+ has_archives: true
+}
+
+woocommerce.post("products/attributes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/products/attributes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product attribute
+This API lets you retrieve and view a specific product attribute by ID.
+
+```http
+GET /wp-json/wc/v2/products/attributes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/attributes/1 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/attributes/1")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/1')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/1").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/1").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/products/attributes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product attributes
+This API helps you to view all the product attributes.
+
+```http
+GET /wp-json/wc/v2/products/attributes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/attributes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/attributes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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/1"
+ }
+ ],
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| --------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope 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
+PUT /wp-json/wc/v2/products/attributes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ order_by: "name"
+};
+
+WooCommerce.put("products/attributes/1", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'order_by' => 'name'
+];
+
+print_r($woocommerce->put('products/attributes/1', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "order_by": "name"
+}
+
+print(wcapi.put("products/attributes/1", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ order_by: "name"
+}
+
+woocommerce.put("products/attributes/1", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/products/attributes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product attribute
+This API helps you delete a product attribute.
+
+```http
+DELETE /wp-json/wc/v2/products/attributes/<id>
+```
+
+:::warning
+This also will delete all terms from the selected attribute.
+:::
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/products/attributes/1?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/attributes/1", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/attributes/1', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/attributes/1", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/attributes/1", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/products/attributes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|---------|---------------------------------------------------------------|
+| `force` | boolean | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/products/attributes/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Brand'
+ ],
+ [
+ 'name' => 'Publisher'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 2,
+ 'order_by' => 'name'
+ ]
+ ],
+ 'delete' => [
+ 1
+ ]
+];
+
+print_r($woocommerce->post('products/attributes/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Brand"
+ },
+ {
+ "name": "Publisher"
+ }
+ ],
+ "update": [
+ {
+ "id": 2,
+ "order_by": "name"
+ }
+ ],
+ "delete": [
+ 1
+ ]
+}
+
+print(wcapi.post("products/attributes/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Brand"
+ },
+ {
+ name: "Publisher"
+ }
+ ],
+ update: [
+ {
+ id: 2,
+ order_by: "name"
+ }
+ ],
+ delete: [
+ 1
+ ]
+}
+
+woocommerce.post("products/attributes/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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/1"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/products/attributes"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/product-categories.mdx b/docs/apis/rest-api/v2/product-categories.mdx
new file mode 100644
index 00000000000..30d01f6ffca
--- /dev/null
+++ b/docs/apis/rest-api/v2/product-categories.mdx
@@ -0,0 +1,1031 @@
+---
+sidebar_position: 13
+sidebar_label: 'Product categories'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product categories
+The product categories API allows you to create, view, update, and delete individual, or a batch, of categories.
+
+## Product category properties
+| Attribute | Type | Description |
+| ------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Category name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `parent` | integer | The ID for the parent of the resource. |
+| `description` | string | HTML description of the resource. |
+| `display` | string | Category archive display type. Options: `default`, `products`, `subcategories` and `both`. Default is `default`. |
+| `image` | object | Image data. See [Product category - Image properties](#product-category---image-properties) |
+| `menu_order` | integer | Menu order, used to custom sort the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+### Product category - Image properties
+| Attribute | Type | Description |
+| ------------------- | --------- | ------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Image ID. |
+| `date_created` | date-time | The date the image was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the image was created, as GMT `READ-ONLY` |
+| `date_modified` | date-time | The date the image was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the image was last modified, as GMT. `READ-ONLY` |
+| `src` | string | Image URL. |
+| `title` | string | Image name. |
+| `alt` | string | Image alternative text. |
+
+## Create a product category
+This API helps you to create a new product category.
+
+```http
+POST /wp-json/wc/v2/products/categories
+```
+
+> Example of how to create a product category:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product category
+This API lets you retrieve a product category by ID.
+
+```http
+GET /wp-json/wc/v2/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/categories/9 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/categories/9")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/categories/9')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/categories/9").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/categories/9").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product categories
+This API lets you retrieve all product categories.
+
+```http
+GET /wp-json/wc/v2/products/categories
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/categories \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/categories")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/categories')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/categories").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/categories").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. Default is `name`. |
+| `hide_empty` | boolean | Whether to hide resources not assigned to any products. Default is `false`. |
+| `parent` | integer | Limit result set to resources assigned to a specific parent. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a product category
+This API lets you make changes to a product category.
+
+```http
+PUT /wp-json/wc/v2/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description' => 'All kinds of clothes.'
+];
+
+print_r($woocommerce->put('products/categories/9', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "All kinds of clothes."
+}
+
+print(wcapi.put("products/categories/9", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "All kinds of clothes."
+}
+
+woocommerce.put("products/categories/9", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product category
+This API helps you delete a product category.
+
+```http
+DELETE /wp-json/wc/v2/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/products/categories/9?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/categories/9", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/categories/9', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/categories/9", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/categories/9", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/products/categories/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Albums'
+ ],
+ [
+ 'name' => 'Clothing'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 10,
+ 'description' => 'Nice hoodies'
+ ]
+ ],
+ 'delete' => [
+ 11,
+ 12
+ ]
+];
+
+print_r($woocommerce->post('products/categories/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Albums"
+ },
+ {
+ "name": "Clothing"
+ }
+ ],
+ "update": [
+ {
+ "id": 10,
+ "description": "Nice hoodies"
+ }
+ ],
+ "delete": [
+ 11,
+ 12
+ ]
+}
+
+print(wcapi.post("products/categories/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Albums"
+ },
+ {
+ name: "Clothing"
+ }
+ ],
+ update: [
+ {
+ id: 10,
+ description: "Nice hoodies"
+ }
+ ],
+ delete: [
+ 11,
+ 12
+ ]
+}
+
+woocommerce.post("products/categories/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/product-shipping-classes.mdx b/docs/apis/rest-api/v2/product-shipping-classes.mdx
new file mode 100644
index 00000000000..42ded17a7a2
--- /dev/null
+++ b/docs/apis/rest-api/v2/product-shipping-classes.mdx
@@ -0,0 +1,742 @@
+---
+sidebar_position: 15
+sidebar_label: 'Product shipping classes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+| ------------- | ------- | ---------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Shipping class name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create a shipping class
+This API helps you to create a new product shipping class.
+
+```http
+POST /wp-json/wc/v2/products/shipping_classes
+```
+
+> Example of how to create a product shipping class:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "Priority"
+};
+
+WooCommerce.post("products/shipping_classes", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Priority'
+];
+
+print_r($woocommerce->post('products/shipping_classes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Priority"
+}
+
+print(wcapi.post("products/shipping_classes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Priority"
+}
+
+woocommerce.post("products/shipping_classes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a shipping class
+This API lets you retrieve a product shipping class by ID.
+
+```http
+GET /wp-json/wc/v2/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/shipping_classes/32 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/shipping_classes/32")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/shipping_classes/32')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/shipping_classes/32").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/shipping_classes/32").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping classes
+This API lets you retrieve all product shipping classes.
+
+```http
+GET /wp-json/wc/v2/products/shipping_classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/shipping_classes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/shipping_classes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/shipping_classes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/shipping_classes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/shipping_classes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. Default is `name`. |
+| `hide_empty` | boolean | Whether to hide resources not assigned to any products. Default is `false`. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a shipping class
+This API lets you make changes to a product shipping class.
+
+```http
+PUT /wp-json/wc/v2/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description' => 'Priority mail.'
+];
+
+print_r($woocommerce->put('products/shipping_classes/32', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "Priority mail."
+}
+
+print(wcapi.put("products/shipping_classes/32", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "Priority mail."
+}
+
+woocommerce.put("products/shipping_classes/32", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a shipping class
+This API helps you delete a product shipping class.
+
+```http
+DELETE /wp-json/wc/v2/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/products/shipping_classes/32?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/shipping_classes/32", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/shipping_classes/32', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/shipping_classes/32", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/shipping_classes/32", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/products/shipping_classes/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/product-tags.mdx b/docs/apis/rest-api/v2/product-tags.mdx
new file mode 100644
index 00000000000..24528c4d40a
--- /dev/null
+++ b/docs/apis/rest-api/v2/product-tags.mdx
@@ -0,0 +1,742 @@
+---
+sidebar_position: 14
+sidebar_label: 'Product tags'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product tags
+The product tags API allows you to create, view, update, and delete individual, or a batch, of product tags.
+
+## Product tag properties
+| Attribute | Type | Description |
+| ------------- | ------- | ---------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Tag name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create a product tag
+This API helps you to create a new product tag.
+
+```http
+POST /wp-json/wc/v2/products/tags
+```
+
+> Example of how to create a product tag:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "Leather Shoes"
+};
+
+WooCommerce.post("products/tags", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Leather Shoes'
+];
+
+print_r($woocommerce->post('products/tags', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Leather Shoes"
+}
+
+print(wcapi.post("products/tags", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Leather Shoes"
+}
+
+woocommerce.post("products/tags", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product tag
+This API lets you retrieve a product tag by ID.
+
+```http
+GET /wp-json/wc/v2/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/tags/34 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/tags/34")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/tags/34')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/tags/34").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/tags/34").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product tags
+This API lets you retrieve all product tag.
+
+```http
+GET /wp-json/wc/v2/products/tags
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/tags \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/tags")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/tags')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/tags").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/tags").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. Default is `name`. |
+| `hide_empty` | boolean | Whether to hide resources not assigned to any products. Default is `false`. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a product tag
+This API lets you make changes to a product tag.
+
+```http
+PUT /wp-json/wc/v2/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ description: "Genuine leather."
+};
+
+WooCommerce.put("products/tags/34", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description': 'Genuine leather.'
+];
+
+print_r($woocommerce->put('products/tags/34', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "Genuine leather."
+}
+
+print(wcapi.put("products/tags/34", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "Genuine leather."
+}
+
+woocommerce.put("products/tags/34", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product tag
+This API helps you delete a product tag.
+
+```http
+DELETE /wp-json/wc/v2/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/products/tags/34?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/tags/34", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/tags/34', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/tags/34", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/tags/34", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/products/tags/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Round toe'
+ ],
+ [
+ 'name' => 'Flat'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 34,
+ 'description' => 'Genuine leather.'
+ ]
+ ],
+ 'delete' => [
+ 35
+ ]
+];
+
+print_r($woocommerce->post('products/tags/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Round toe"
+ },
+ {
+ "name": "Flat"
+ }
+ ],
+ "update": [
+ {
+ "id": 34,
+ "description": "Genuine leather."
+ }
+ ],
+ "delete": [
+ 35
+ ]
+}
+
+print(wcapi.post("products/tags/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Round toe"
+ },
+ {
+ name: "Flat"
+ }
+ ],
+ update: [
+ {
+ id: 34,
+ description: "Genuine leather."
+ }
+ ],
+ delete: [
+ 35
+ ]
+}
+
+woocommerce.post("products/tags/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/product-variations.mdx b/docs/apis/rest-api/v2/product-variations.mdx
new file mode 100644
index 00000000000..ef20da411a9
--- /dev/null
+++ b/docs/apis/rest-api/v2/product-variations.mdx
@@ -0,0 +1,1527 @@
+---
+sidebar_position: 10
+sidebar_label: 'Product variations'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product variations
+The product variations API allows you to create, view, update, and delete individual, or a batch, of product variations.
+
+## Product variation properties
+| Attribute | Type | Description |
+|-------------------------|-----------|---------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the variation was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the variation was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the variation was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the variation was last modified, as GMT. `READ-ONLY` |
+| `description` | string | Variation description. |
+| `permalink` | string | Variation URL. `READ-ONLY` |
+| `sku` | string | Unique identifier. |
+| `price` | string | Current variation price. `READ-ONLY` |
+| `regular_price` | string | Variation regular price. |
+| `sale_price` | string | Variation sale price. |
+| `date_on_sale_from` | date-time | Start date of sale price, in the site's timezone. |
+| `date_on_sale_from_gmt` | date-time | Start date of sale price, as GMT. |
+| `date_on_sale_to` | date-time | End date of sale price, in the site's timezone. |
+| `date_on_sale_to_gmt` | date-time | End date of sale price, as GMT. |
+| `on_sale` | boolean | Shows if the variation is on sale. `READ-ONLY` |
+| `visible` | boolean | Define if the attribute is visible on the "Additional information" tab in the product's page. Default is `true`. |
+| `purchasable` | boolean | Shows if the variation can be bought. `READ-ONLY` |
+| `virtual` | boolean | If the variation is virtual. Default is `false`. |
+| `downloadable` | boolean | If the variation is downloadable. Default is `false`. |
+| `downloads` | array | List of downloadable files. See [Product variation - Downloads properties](#product-variation---downloads-properties) |
+| `download_limit` | integer | Number of times downloadable files can be downloaded after purchase. Default is `-1`. |
+| `download_expiry` | integer | Number of days until access to downloadable files expires. Default is `-1`. |
+| `tax_status` | string | Tax status. Options: `taxable`, `shipping` and `none`. Default is `taxable`. |
+| `tax_class` | string | Tax class. |
+| `manage_stock` | boolean, string | Stock management at variation level. Possible values are either a boolean or `parent`. Default is `false`. |
+| `stock_quantity` | integer | Stock quantity. |
+| `in_stock` | boolean | Controls whether or not the variation is listed as "in stock" or "out of stock" on the frontend. Default is `true`. |
+| `backorders` | string | If managing stock, this controls if backorders are allowed. Options: `no`, `notify` and `yes`. Default is `no`. |
+| `backorders_allowed` | boolean | Shows if backorders are allowed. `READ-ONLY` |
+| `backordered` | boolean | Shows if the variation is on backordered. `READ-ONLY` |
+| `weight` | string | Variation weight. |
+| `dimensions` | object | Variation dimensions. See [Product variation - Dimensions properties](#product-variation---dimensions-properties) |
+| `shipping_class` | string | Shipping class slug. |
+| `shipping_class_id` | string | Shipping class ID. `READ-ONLY` |
+| `image` | object | Variation image data. See [Product variation - Image properties](#product-variation---image-properties) |
+| `attributes` | array | List of attributes. See [Product variation - Attributes properties](#product-variation---attributes-properties) |
+| `menu_order` | integer | Menu order, used to custom sort products. |
+| `meta_data` | array | Meta data. See [Product variation - Meta data properties](#product-variation---meta-data-properties) |
+
+### Product variation - Downloads properties
+| Attribute | Type | Description |
+|-----------|--------|-------------|
+| `id` | string | File ID. |
+| `name` | string | File name. |
+| `file` | string | File URL. |
+
+### Product variation - Dimensions properties
+| Attribute | Type | Description |
+|-----------|--------|-------------------|
+| `length` | string | Variation length. |
+| `width` | string | Variation width. |
+| `height` | string | Variation height. |
+
+### Product variation - Image properties
+| Attribute | Type | Description |
+|---------------------|-----------|---------------------------------------------------------------------------------------------------------|
+| `id` | integer | Image ID. |
+| `date_created` | date-time | The date the image was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the image was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the image was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the image was last modified, as GMT. `READ-ONLY` |
+| `src` | string | Image URL. |
+| `name` | string | Image name. |
+| `alt` | string | Image alternative text. |
+| `position` | integer | Image position. 0 means that the image is featured. |
+
+### Product variation - Attributes properties
+| Attribute | Type | Description |
+|-----------|---------|-------------------------------|
+| `id` | integer | Attribute ID. |
+| `name` | string | Attribute name. |
+| `option` | string | Selected attribute term name. |
+
+### Product variation - Meta data properties
+| Attribute | Type | Description |
+|-----------|---------|----------------------------------------------------|
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+## Create a product variation
+This API helps you to create a new product variation.
+
+```http
+POST /wp-json/wc/v2/products/<product_id>/variations
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'regular_price' => '9.00',
+ 'image' => [
+ 'id' => 423
+ ],
+ 'attributes' => [
+ [
+ 'id' => 9,
+ 'option' => 'Black'
+ ]
+ ]
+];
+
+print_r($woocommerce->post('products/22/variations', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "regular_price": "9.00",
+ "image": {
+ "id": 423
+ },
+ "attributes": [
+ {
+ "id": 9,
+ "option": "Black"
+ }
+ ]
+}
+
+print(wcapi.post("products/22/variations", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ regular_price: "9.00",
+ image: {
+ id: 423
+ },
+ attributes: [
+ {
+ id: 9,
+ position: "Black"
+ }
+ ]
+}
+
+woocommerce.post("products/22/variations", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product variation
+This API lets you retrieve and view a specific product variation by ID.
+
+```http
+GET /wp-json/wc/v2/products/<product_id>/variations/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/22/variations/732 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/22/variations/732")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/22/variations/732')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/22/variations/732").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/22/variations/732").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product variations
+This API helps you to view all the product variations.
+
+```http
+GET /wp-json/wc/v2/products/<product_id>/variations
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/22/variations \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/22/variations")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/22/variations')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/22/variations").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/22/variations").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `slug` | string | Limit result set to products with a specific slug. |
+| `status` | string | Limit result set to products assigned a specific status. Options: `any`, `draft`, `pending`, `private` and `publish`. Default is `any`. |
+| `type` | string | Limit result set to products assigned a specific type. Options: `simple`, `grouped`, `external` and `variable`. |
+| `sku` | string | Limit result set to products with a specific SKU. |
+| `featured` | boolean | Limit result set to featured products. |
+| `category` | string | Limit result set to products assigned a specific category ID. |
+| `tag` | string | Limit result set to products assigned a specific tag ID. |
+| `shipping_class` | string | Limit result set to products assigned a specific shipping class ID. |
+| `attribute` | string | Limit result set to products with a specific attribute. |
+| `attribute_term` | string | Limit result set to products with a specific attribute term ID (required an assigned attribute). |
+| `tax_class` | string | Limit result set to products with a specific tax class. Default options: `standard`, `reduced-rate` and `zero-rate`. |
+| `in_stock` | boolean | Limit result set to products in stock or out of stock. |
+| `on_sale` | boolean | Limit result set to products on sale. |
+| `min_price` | string | Limit result set to products based on a minimum price. |
+| `max_price` | string | Limit result set to products based on a maximum price. |
+
+## Update a product variation
+This API lets you make changes to a product variation.
+
+```http
+PUT /wp-json/wc/v2/products/<product_id>/variations/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'regular_price' => '10.00'
+];
+
+print_r($woocommerce->put('products/22/variations/733', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "regular_price": "10.00"
+}
+
+print(wcapi.put("products/22/variations/733", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ regular_price: "10.00"
+}
+
+woocommerce.put("products/22/variations/733", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product variation
+This API helps you delete a product variation.
+
+```http
+DELETE /wp-json/wc/v2/products/<product_id>/variations/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/products/22/variations/733?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/22/variations/733", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/22/variations/733', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/22/variations/733", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/22/variations/733", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/products/<product_id>/variations/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/products.mdx b/docs/apis/rest-api/v2/products.mdx
new file mode 100644
index 00000000000..50082752e17
--- /dev/null
+++ b/docs/apis/rest-api/v2/products.mdx
@@ -0,0 +1,3222 @@
+---
+sidebar_position: 9
+sidebar_label: 'Products'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Products
+The products API allows you to create, view, update, and delete individual, or a batch, of products.
+
+## Product properties
+| Attribute | Type | Description | | |
+|-------------------------|-----------|----------------------------------------------------------------------------------------------------------------------|-------|-------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` | | |
+| `name` | string | Product name. | | |
+| `slug` | string | Product slug. | | |
+| `permalink` | string | Product URL. `READ-ONLY` | | |
+| `date_created` | date-time | The date the product was created, in the site's timezone. `READ-ONLY` | | |
+| `date_created_gmt` | date-time | The date the product was created, as GMT. `READ-ONLY` | | |
+| `date_modified` | date-time | The date the product was last modified, in the site's timezone. `READ-ONLY` | | |
+| `date_modified_gmt` | date-time | The date the product was last modified, as GMT. `READ-ONLY` | | |
+| `type` | string | Product type. Options: `simple`, `grouped`, `external` and `variable`. Default is `simple`. | | |
+| `status` | string | Product status (post status). Options: `draft`, `pending`, `private` and `publish`. Default is `publish`. | | |
+| `featured` | boolean | Featured product. Default is `false`. | | |
+| `catalog_visibility` | string | Catalog visibility. Options: `visible`, `catalog`, `search` and `hidden`. Default is `visible`. | | |
+| `description` | string | Product description. | | |
+| `short_description` | string | Product short description. | | |
+| `sku` | string | Unique identifier. | | |
+| `price` | string | Current product price. `READ-ONLY` | | |
+| `regular_price` | string | Product regular price. | | |
+| `sale_price` | string | Product sale price. | | |
+| `date_on_sale_from` | date-time | Start date of sale price, in the site's timezone. | | |
+| `date_on_sale_from_gmt` | date-time | Start date of sale price, as GMT. | | |
+| `date_on_sale_to` | date-time | End date of sale price, in the site's timezone. | | |
+| `date_on_sale_to_gmt` | date-time | End date of sale price, as GMT. | | |
+| `price_html` | string | Price formatted in HTML. `READ-ONLY` | | |
+| `on_sale` | boolean | Shows if the product is on sale. `READ-ONLY` | | |
+| `purchasable` | boolean | Shows if the product can be bought. `READ-ONLY` | | |
+| `total_sales` | integer | Amount of sales. `READ-ONLY` | | |
+| `virtual` | boolean | If the product is virtual. Default is `false`. | | |
+| `downloadable` | boolean | If the product is downloadable. Default is `false`. | | |
+| `downloads` | array | List of downloadable files. See [Product - Downloads properties](#product---downloads-properties) | | |
+| `download_limit` | integer | Number of times downloadable files can be downloaded after purchase. Default is `-1`. | | |
+| `download_expiry` | integer | Number of days until access to downloadable files expires. Default is `-1`. | | |
+| `external_url` | string | Product external URL. Only for external products. | | |
+| `button_text` | string | Product external button text. Only for external products. | | |
+| `tax_status` | string | Tax status. Options: `taxable`, `shipping` and `none`. Default is `taxable`. | | |
+| `tax_class` | string | Tax class. | | |
+| `manage_stock` | boolean | Stock management at product level. Default is `false`. | | |
+| `stock_quantity` | integer | Stock quantity. | | |
+| `in_stock` | boolean | Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend. Default is `true`. | | |
+| `backorders` | string | If managing stock, this controls if backorders are allowed. Options: `no`, `notify` and `yes`. Default is `no`. | | |
+| `backorders_allowed` | boolean | Shows if backorders are allowed. `READ-ONLY` | | |
+| `backordered` | boolean | Shows if the product is on backordered. `READ-ONLY` | | |
+| `sold_individually` | boolean | Allow one item to be bought in a single order. Default is `false`. | | |
+| `weight` | string | Product weight. | | |
+| `dimensions` | object | Product dimensions. See [Product - Dimensions properties](#product---dimensions-properties) | | |
+| `shipping_required` | boolean | Shows if the product need to be shipped. `READ-ONLY` | | |
+| `shipping_taxable` | boolean | Shows whether or not the product shipping is taxable. `READ-ONLY` | | |
+| `shipping_class` | string | Shipping class slug. | | |
+| `shipping_class_id` | integer | Shipping class ID. `READ-ONLY` | | |
+| `reviews_allowed` | boolean | Allow reviews. Default is `true`. | | |
+| `average_rating` | string | Reviews average rating. `READ-ONLY` | | |
+| `rating_count` | integer | Amount of reviews that the product have. `READ-ONLY` | | |
+| `related_ids` | array | List of related products IDs. `READ-ONLY` | | |
+| `upsell_ids` | array | List of up-sell products IDs. | | |
+| `cross_sell_ids` | array | List of cross-sell products IDs. | | |
+| `parent_id` | integer | Product parent ID. | | |
+| `purchase_note` | string | Optional note to send the customer after purchase. | | |
+| `categories` | array | List of categories. See [Product - Categories properties](#product---categories-properties) | | |
+| `tags` | array | List of tags. See [Product - Tags properties](#product---tags-properties) | array | List of images. See [Product - Images properties](#product---images-properties) |
+| `attributes` | array | List of attributes. See [Product - Attributes properties](#product---attributes-properties) | | |
+| `default_attributes` | array | Defaults variation attributes. See [Product - Default attributes properties](#product---default-attributes-properties) | | |
+| `variations` | array | List of variations IDs. `READ-ONLY` | | |
+| `grouped_products` | array | List of grouped products ID. | | |
+| `menu_order` | integer | Menu order, used to custom sort products. | | |
+| `meta_data` | array | Meta data. See [Product - Meta data properties](#product---meta-data-properties) | | |
+
+### Product - Downloads properties
+| Attribute | Type | Description |
+|-----------|--------|-------------|
+| `id` | string | File ID. |
+| `name` | string | File name. |
+| `file` | string | File URL. |
+
+### Product - Dimensions properties
+| Attribute | Type | Description |
+|-----------|--------|-----------------|
+| `length` | string | Product length. |
+| `width` | string | Product width. |
+| `height` | string | Product height. |
+
+### Product - Categories properties
+| Attribute | Type | Description |
+|-----------|---------|----------------------------------------------------------|
+| `id` | integer | Category ID. |
+| `name` | string | Category name. `READ-ONLY` |
+| `slug` | string | Category slug. `READ-ONLY` |
+
+### Product - Tags properties
+| Attribute | Type | Description |
+|-----------|---------|-----------------------------------------------------|
+| `id` | integer | Tag ID. |
+| `name` | string | Tag name. `READ-ONLY` |
+| `slug` | string | Tag slug. `READ-ONLY` |
+
+### Product - Images properties
+| Attribute | Type | Description |
+|---------------------|-----------|---------------------------------------------------------------------------------------------------------|
+| `id` | integer | Image ID. |
+| `date_created` | date-time | The date the image was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the image was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the image was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the image was last modified, as GMT. `READ-ONLY` |
+| `src` | string | Image URL. |
+| `name` | string | Image name. |
+| `alt` | string | Image alternative text. |
+| `position` | integer | Image position. 0 means that the image is featured. |
+
+### Product - Attributes properties
+| Attribute | Type | Description |
+|-------------|---------|-------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Attribute ID. |
+| `name` | string | Attribute name. |
+| `position` | integer | Attribute position. |
+| `visible` | boolean | Define if the attribute is visible on the "Additional information" tab in the product's page. Default is `false`. |
+| `variation` | boolean | Define if the attribute can be used as variation. Default is `false`. |
+| `options` | array | List of available term names of the attribute. |
+
+### Product - Default attributes properties
+| Attribute | Type | Description |
+|-----------|---------|-------------------------------|
+| `id` | integer | Attribute ID. |
+| `name` | string | Attribute name. |
+| `option` | string | Selected attribute term name. |
+
+### Product - Meta data properties
+| Attribute | Type | Description |
+|-----------|---------|----------------------------------------------------|
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+## Create a product
+This API helps you to create a new product.
+
+```http
+POST /wp-json/wc/v2/products
+```
+
+> Example of how to create a `simple` product:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+> Example of how to create a `variable` product with global and non-global attributes:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product
+This API lets you retrieve and view a specific product by ID.
+
+```http
+GET /wp-json/wc/v2/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/794 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/794")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/794')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/794").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/794").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all products
+This API helps you to view all the products.
+
+```http
+GET /wp-json/wc/v2/products
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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\">$</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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------------|---------|-----------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `slug` | string | Limit result set to products with a specific slug. |
+| `status` | string | Limit result set to products assigned a specific status. Options: `any`, `draft`, `pending`, `private` and `publish`. Default is `any`. |
+| `type` | string | Limit result set to products assigned a specific type. Options: `simple`, `grouped`, `external` and `variable`. |
+| `sku` | string | Limit result set to products with a specific SKU. |
+| `featured` | boolean | Limit result set to featured products. |
+| `category` | string | Limit result set to products assigned a specific category ID. |
+| `tag` | string | Limit result set to products assigned a specific tag ID. |
+| `shipping_class` | string | Limit result set to products assigned a specific shipping class ID. |
+| `attribute` | string | Limit result set to products with a specific attribute. |
+| `attribute_term` | string | Limit result set to products with a specific attribute term ID (required an assigned attribute). |
+| `tax_class` | string | Limit result set to products with a specific tax class. Default options: `standard`, `reduced-rate` and `zero-rate`. |
+| `in_stock` | boolean | Limit result set to products in stock or out of stock. |
+| `on_sale` | boolean | Limit result set to products on sale. |
+| `min_price` | string | Limit result set to products based on a minimum price. |
+| `max_price` | string | Limit result set to products based on a maximum price. |
+
+## Update a product
+This API lets you make changes to a product.
+
+```http
+PUT /wp-json/wc/v2/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ regular_price: "24.54"
+};
+
+WooCommerce.put("products/794", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'regular_price' => '24.54'
+];
+
+print_r($woocommerce->put('products/794', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "regular_price": "24.54"
+}
+
+print(wcapi.put("products/794", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ regular_price: "24.54"
+}
+
+woocommerce.put("products/794", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product
+This API helps you delete a product.
+
+```http
+DELETE /wp-json/wc/v2/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/products/794?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("products/794", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/794', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/794", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/794", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------------------|
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/products/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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\">$</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\">$</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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve product reviews
+This API lets you retrieve and view a specific product review by ID.
+
+```http
+GET /wp-json/wc/v2/products/<product_id>/reviews/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/22/reviews/5 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/products/22/reviews/5")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/22/reviews/5')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/products/22/reviews/5").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/products/22/reviews/5").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Product review properties
+| Attribute | Type | Description |
+|--------------------|-----------|--------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `review` | string | The content of the review. `MANDATORY` |
+| `date_created` | date-time | The date the review was created, in the site's timezone. |
+| `date_created_gmt` | date-time | The date the review was created, as GMT. |
+| `rating` | integer | Review rating (0 to 5). |
+| `name` | string | Reviewer name. `MANDATORY` |
+| `email` | string | Reviewer email. `MANDATORY` |
+| `verified` | boolean | Shows if the reviewer bought the product or not. `READ-ONLY` |
+
+## List all product reviews
+This API lets you retrieve all reviews of a product.
+
+```http
+GET /wp-json/wc/v2/products/<product_id>/reviews
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/products/22/reviews \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("products/22/reviews")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/22/reviews')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/22/reviews").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/22/reviews").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/reports.mdx b/docs/apis/rest-api/v2/reports.mdx
new file mode 100644
index 00000000000..7ce9f9af54d
--- /dev/null
+++ b/docs/apis/rest-api/v2/reports.mdx
@@ -0,0 +1,361 @@
+---
+sidebar_position: 16
+sidebar_label: 'Reports'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+GET /wp-json/wc/v2/reports
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/reports \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("reports")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('reports')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("reports").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve sales report
+This API lets you retrieve and view a sales report.
+
+```http
+GET /wp-json/wc/v2/reports/sales
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$query = [
+ 'date_min' => '2016-05-03',
+ 'date_max' => '2016-05-04'
+];
+
+print_r($woocommerce->get('reports/sales', $query));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/sales?date_min=2016-05-03&date_max=2016-05-04").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+query = {
+ date_min: "2016-05-03",
+ date_max: "2016-05-04"
+}
+
+woocommerce.get("reports/sales", query).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Sales report properties
+| Attribute | Type | Description |
+|---------------------|---------|-----------------------------------------------------------------------|
+| `total_sales` | string | Gross sales in the period. `READ-ONLY` |
+| `net_sales` | string | Net sales in the period. `READ-ONLY` |
+| `average_sales` | string | Average net daily sales. `READ-ONLY` |
+| `total_orders` | integer | Total of orders placed. `READ-ONLY` |
+| `total_items` | integer | Total of items purchased. `READ-ONLY` |
+| `total_tax` | string | Total charged for taxes. `READ-ONLY` |
+| `total_shipping` | string | Total charged for shipping. `READ-ONLY` |
+| `total_refunds` | number | Total of refunded orders. `READ-ONLY` |
+| `total_discount` | integer | Total of coupons used. `READ-ONLY` |
+| `totals_grouped_by` | string | Group type. `READ-ONLY` |
+| `totals` | array | Totals. `READ-ONLY` |
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------|--------|-------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Default is `view`. Options: `view`. |
+| `period` | string | Report period. Default is today's date. Options: `week`, `month`, `last_month` and `year` |
+| `date_min` | string | Return sales for a specific start date, the date need to be in the YYYY-MM-DD format. |
+| `date_max` | string | Return 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
+GET /wp-json/wc/v2/reports/top_sellers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/reports/top_sellers?period=last_month \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("reports/top_sellers", {
+ period: "last_month"
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$query = [
+ 'period' => 'last_month'
+];
+
+print_r($woocommerce->get('reports/top_sellers', $query));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/top_sellers?period=last_month").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+query = {
+ period: "last_month"
+}
+
+woocommerce.get("reports/top_sellers", query).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Top sellers report properties
+| Attribute | Type | Description |
+|---------------------|---------|-----------------------------------------------------------------------|
+| `title` | string | Product title. `READ-ONLY` |
+| `product_id` | integer | Product ID. `READ-ONLY` |
+| `quantity` | integer | Total number of purchases. `READ-ONLY` |
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------|--------|-------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Default is `view`. Options: `view`. |
+| `period` | string | Report period. Default is `week`. Options: `week`, `month`, `last_month` and `year` |
+| `date_min` | string | Return sales for a specific start date, the date need to be in the YYYY-MM-DD format. |
+| `date_max` | string | Return sales for a specific end date, the date need to be in the YYYY-MM-DD format. |
diff --git a/docs/apis/rest-api/v2/setting-options.mdx b/docs/apis/rest-api/v2/setting-options.mdx
new file mode 100644
index 00000000000..d8505f675e3
--- /dev/null
+++ b/docs/apis/rest-api/v2/setting-options.mdx
@@ -0,0 +1,1941 @@
+---
+sidebar_position: 26
+sidebar_label: 'Setting options'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Setting options
+## Setting option properties
+| Attribute | Type | Description |
+| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier for the setting. `READ-ONLY` |
+| `label` | string | A human readable label for the setting used in interfaces. `READ-ONLY` |
+| `description` | string | A human readable description for the setting used in interfaces. `READ-ONLY` |
+| `value` | mixed | Setting value. |
+| `default` | mixed | Default value for the setting. `READ-ONLY` |
+| `tip` | string | Additional help text shown to the user about the setting. `READ-ONLY` |
+| `placeholder` | string | Placeholder text to be displayed in text inputs. `READ-ONLY` |
+| `type` | string | Type of setting. Options: `text`, `email`, `number`, `color`, `password`, `textarea`, `select`, `multiselect`, `radio`, `image_width` and `checkbox`. `READ-ONLY` |
+| `options` | object | Array 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
+GET /wp-json/wc/v2/settings/<group_id>/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/settings/general/woocommerce_allowed_countries \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("settings/general/woocommerce_allowed_countries")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('settings/general/woocommerce_allowed_countries')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("settings/general/woocommerce_allowed_countries").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("settings/general/woocommerce_allowed_countries").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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…",
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all setting options
+This API helps you to view all the setting options.
+
+```http
+GET /wp-json/wc/v2/settings/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/settings/general \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("settings/general")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('settings/general')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("settings/general").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("settings/general").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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…",
+ "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…",
+ "description": "",
+ "type": "multiselect",
+ "default": "",
+ "value": "",
+ "options": {
+ "AX": "Å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ç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ão Tomé and Príncipe",
+ "BL": "Saint Barthé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": "Å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ç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ão Tomé and Príncipe",
+ "BL": "Saint Barthé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 & 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": "Å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ç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ão Tomé and Príncipe",
+ "BL": "Saint Barthé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 — no orders shall be fulfilled.",
+ "value": "This is a demo store for testing purposes — 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 (د.إ)",
+ "AFN": "Afghan afghani (؋)",
+ "ALL": "Albanian lek (L)",
+ "AMD": "Armenian dram (AMD)",
+ "ANG": "Netherlands Antillean guilder (ƒ)",
+ "AOA": "Angolan kwanza (Kz)",
+ "ARS": "Argentine peso ($)",
+ "AUD": "Australian dollar ($)",
+ "AWG": "Aruban florin (ƒ)",
+ "AZN": "Azerbaijani manat (AZN)",
+ "BAM": "Bosnia and Herzegovina convertible mark (KM)",
+ "BBD": "Barbadian dollar ($)",
+ "BDT": "Bangladeshi taka (৳ )",
+ "BGN": "Bulgarian lev (лв.)",
+ "BHD": "Bahraini dinar (.د.ب)",
+ "BIF": "Burundian franc (Fr)",
+ "BMD": "Bermudian dollar ($)",
+ "BND": "Brunei dollar ($)",
+ "BOB": "Bolivian boliviano (Bs.)",
+ "BRL": "Brazilian real (R$)",
+ "BSD": "Bahamian dollar ($)",
+ "BTC": "Bitcoin (฿)",
+ "BTN": "Bhutanese ngultrum (Nu.)",
+ "BWP": "Botswana pula (P)",
+ "BYR": "Belarusian ruble (Br)",
+ "BZD": "Belize dollar ($)",
+ "CAD": "Canadian dollar ($)",
+ "CDF": "Congolese franc (Fr)",
+ "CHF": "Swiss franc (CHF)",
+ "CLP": "Chilean peso ($)",
+ "CNY": "Chinese yuan (¥)",
+ "COP": "Colombian peso ($)",
+ "CRC": "Costa Rican colón (₡)",
+ "CUC": "Cuban convertible peso ($)",
+ "CUP": "Cuban peso ($)",
+ "CVE": "Cape Verdean escudo ($)",
+ "CZK": "Czech koruna (Kč)",
+ "DJF": "Djiboutian franc (Fr)",
+ "DKK": "Danish krone (DKK)",
+ "DOP": "Dominican peso (RD$)",
+ "DZD": "Algerian dinar (د.ج)",
+ "EGP": "Egyptian pound (EGP)",
+ "ERN": "Eritrean nakfa (Nfk)",
+ "ETB": "Ethiopian birr (Br)",
+ "EUR": "Euro (€)",
+ "FJD": "Fijian dollar ($)",
+ "FKP": "Falkland Islands pound (£)",
+ "GBP": "Pound sterling (£)",
+ "GEL": "Georgian lari (ლ)",
+ "GGP": "Guernsey pound (£)",
+ "GHS": "Ghana cedi (₵)",
+ "GIP": "Gibraltar pound (£)",
+ "GMD": "Gambian dalasi (D)",
+ "GNF": "Guinean franc (Fr)",
+ "GTQ": "Guatemalan quetzal (Q)",
+ "GYD": "Guyanese dollar ($)",
+ "HKD": "Hong Kong dollar ($)",
+ "HNL": "Honduran lempira (L)",
+ "HRK": "Croatian kuna (Kn)",
+ "HTG": "Haitian gourde (G)",
+ "HUF": "Hungarian forint (Ft)",
+ "IDR": "Indonesian rupiah (Rp)",
+ "ILS": "Israeli new shekel (₪)",
+ "IMP": "Manx pound (£)",
+ "INR": "Indian rupee (₹)",
+ "IQD": "Iraqi dinar (ع.د)",
+ "IRR": "Iranian rial (﷼)",
+ "IRT": "Iranian toman (تومان)",
+ "ISK": "Icelandic króna (kr.)",
+ "JEP": "Jersey pound (£)",
+ "JMD": "Jamaican dollar ($)",
+ "JOD": "Jordanian dinar (د.ا)",
+ "JPY": "Japanese yen (¥)",
+ "KES": "Kenyan shilling (KSh)",
+ "KGS": "Kyrgyzstani som (сом)",
+ "KHR": "Cambodian riel (៛)",
+ "KMF": "Comorian franc (Fr)",
+ "KPW": "North Korean won (₩)",
+ "KRW": "South Korean won (₩)",
+ "KWD": "Kuwaiti dinar (د.ك)",
+ "KYD": "Cayman Islands dollar ($)",
+ "KZT": "Kazakhstani tenge (KZT)",
+ "LAK": "Lao kip (₭)",
+ "LBP": "Lebanese pound (ل.ل)",
+ "LKR": "Sri Lankan rupee (රු)",
+ "LRD": "Liberian dollar ($)",
+ "LSL": "Lesotho loti (L)",
+ "LYD": "Libyan dinar (ل.د)",
+ "MAD": "Moroccan dirham (د.م.)",
+ "MDL": "Moldovan leu (MDL)",
+ "MGA": "Malagasy ariary (Ar)",
+ "MKD": "Macedonian denar (ден)",
+ "MMK": "Burmese kyat (Ks)",
+ "MNT": "Mongolian tögrög (₮)",
+ "MOP": "Macanese pataca (P)",
+ "MRO": "Mauritanian ouguiya (UM)",
+ "MUR": "Mauritian rupee (₨)",
+ "MVR": "Maldivian rufiyaa (.ރ)",
+ "MWK": "Malawian kwacha (MK)",
+ "MXN": "Mexican peso ($)",
+ "MYR": "Malaysian ringgit (RM)",
+ "MZN": "Mozambican metical (MT)",
+ "NAD": "Namibian dollar ($)",
+ "NGN": "Nigerian naira (₦)",
+ "NIO": "Nicaraguan córdoba (C$)",
+ "NOK": "Norwegian krone (kr)",
+ "NPR": "Nepalese rupee (₨)",
+ "NZD": "New Zealand dollar ($)",
+ "OMR": "Omani rial (ر.ع.)",
+ "PAB": "Panamanian balboa (B/.)",
+ "PEN": "Peruvian nuevo sol (S/.)",
+ "PGK": "Papua New Guinean kina (K)",
+ "PHP": "Philippine peso (₱)",
+ "PKR": "Pakistani rupee (₨)",
+ "PLN": "Polish złoty (zł)",
+ "PRB": "Transnistrian ruble (р.)",
+ "PYG": "Paraguayan guaraní (₲)",
+ "QAR": "Qatari riyal (ر.ق)",
+ "RON": "Romanian leu (lei)",
+ "RSD": "Serbian dinar (дин.)",
+ "RUB": "Russian ruble (₽)",
+ "RWF": "Rwandan franc (Fr)",
+ "SAR": "Saudi riyal (ر.س)",
+ "SBD": "Solomon Islands dollar ($)",
+ "SCR": "Seychellois rupee (₨)",
+ "SDG": "Sudanese pound (ج.س.)",
+ "SEK": "Swedish krona (kr)",
+ "SGD": "Singapore dollar ($)",
+ "SHP": "Saint Helena pound (£)",
+ "SLL": "Sierra Leonean leone (Le)",
+ "SOS": "Somali shilling (Sh)",
+ "SRD": "Surinamese dollar ($)",
+ "SSP": "South Sudanese pound (£)",
+ "STD": "São Tomé and Príncipe dobra (Db)",
+ "SYP": "Syrian pound (ل.س)",
+ "SZL": "Swazi lilangeni (L)",
+ "THB": "Thai baht (฿)",
+ "TJS": "Tajikistani somoni (ЅМ)",
+ "TMT": "Turkmenistan manat (m)",
+ "TND": "Tunisian dinar (د.ت)",
+ "TOP": "Tongan paʻanga (T$)",
+ "TRY": "Turkish lira (₺)",
+ "TTD": "Trinidad and Tobago dollar ($)",
+ "TWD": "New Taiwan dollar (NT$)",
+ "TZS": "Tanzanian shilling (Sh)",
+ "UAH": "Ukrainian hryvnia (₴)",
+ "UGX": "Ugandan shilling (UGX)",
+ "USD": "United States dollar ($)",
+ "UYU": "Uruguayan peso ($)",
+ "UZS": "Uzbekistani som (UZS)",
+ "VEF": "Venezuelan bolívar (Bs F)",
+ "VND": "Vietnamese đồng (₫)",
+ "VUV": "Vanuatu vatu (Vt)",
+ "WST": "Samoan tālā (T)",
+ "XAF": "Central African CFA franc (Fr)",
+ "XCD": "East Caribbean dollar ($)",
+ "XOF": "West African CFA franc (Fr)",
+ "XPF": "CFP franc (Fr)",
+ "YER": "Yemeni rial (﷼)",
+ "ZAR": "South African rand (R)",
+ "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 ($99.99)",
+ "right": "Right (99.99$)",
+ "left_space": "Left with space ($ 99.99)",
+ "right_space": "Right with space (99.99 $)"
+ },
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a setting option
+This API lets you make changes to a setting option.
+
+```http
+PUT /wp-json/wc/v2/settings/<group_id>/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'value' => 'all_except'
+];
+
+print_r($woocommerce->put('settings/general/woocommerce_allowed_countries', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "value": "all_except"
+}
+
+print(wcapi.put("settings/general/woocommerce_allowed_countries", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ value: "all_except"
+}
+
+woocommerce.put("settings/general/woocommerce_allowed_countries", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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…",
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Batch update setting options
+This API helps you to batch update multiple setting options.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/settings/<id>/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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…",
+ "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 (د.إ)",
+ "AFN": "Afghan afghani (؋)",
+ "ALL": "Albanian lek (L)",
+ "AMD": "Armenian dram (AMD)",
+ "ANG": "Netherlands Antillean guilder (ƒ)",
+ "AOA": "Angolan kwanza (Kz)",
+ "ARS": "Argentine peso ($)",
+ "AUD": "Australian dollar ($)",
+ "AWG": "Aruban florin (ƒ)",
+ "AZN": "Azerbaijani manat (AZN)",
+ "BAM": "Bosnia and Herzegovina convertible mark (KM)",
+ "BBD": "Barbadian dollar ($)",
+ "BDT": "Bangladeshi taka (৳ )",
+ "BGN": "Bulgarian lev (лв.)",
+ "BHD": "Bahraini dinar (.د.ب)",
+ "BIF": "Burundian franc (Fr)",
+ "BMD": "Bermudian dollar ($)",
+ "BND": "Brunei dollar ($)",
+ "BOB": "Bolivian boliviano (Bs.)",
+ "BRL": "Brazilian real (R$)",
+ "BSD": "Bahamian dollar ($)",
+ "BTC": "Bitcoin (฿)",
+ "BTN": "Bhutanese ngultrum (Nu.)",
+ "BWP": "Botswana pula (P)",
+ "BYR": "Belarusian ruble (Br)",
+ "BZD": "Belize dollar ($)",
+ "CAD": "Canadian dollar ($)",
+ "CDF": "Congolese franc (Fr)",
+ "CHF": "Swiss franc (CHF)",
+ "CLP": "Chilean peso ($)",
+ "CNY": "Chinese yuan (¥)",
+ "COP": "Colombian peso ($)",
+ "CRC": "Costa Rican colón (₡)",
+ "CUC": "Cuban convertible peso ($)",
+ "CUP": "Cuban peso ($)",
+ "CVE": "Cape Verdean escudo ($)",
+ "CZK": "Czech koruna (Kč)",
+ "DJF": "Djiboutian franc (Fr)",
+ "DKK": "Danish krone (DKK)",
+ "DOP": "Dominican peso (RD$)",
+ "DZD": "Algerian dinar (د.ج)",
+ "EGP": "Egyptian pound (EGP)",
+ "ERN": "Eritrean nakfa (Nfk)",
+ "ETB": "Ethiopian birr (Br)",
+ "EUR": "Euro (€)",
+ "FJD": "Fijian dollar ($)",
+ "FKP": "Falkland Islands pound (£)",
+ "GBP": "Pound sterling (£)",
+ "GEL": "Georgian lari (ლ)",
+ "GGP": "Guernsey pound (£)",
+ "GHS": "Ghana cedi (₵)",
+ "GIP": "Gibraltar pound (£)",
+ "GMD": "Gambian dalasi (D)",
+ "GNF": "Guinean franc (Fr)",
+ "GTQ": "Guatemalan quetzal (Q)",
+ "GYD": "Guyanese dollar ($)",
+ "HKD": "Hong Kong dollar ($)",
+ "HNL": "Honduran lempira (L)",
+ "HRK": "Croatian kuna (Kn)",
+ "HTG": "Haitian gourde (G)",
+ "HUF": "Hungarian forint (Ft)",
+ "IDR": "Indonesian rupiah (Rp)",
+ "ILS": "Israeli new shekel (₪)",
+ "IMP": "Manx pound (£)",
+ "INR": "Indian rupee (₹)",
+ "IQD": "Iraqi dinar (ع.د)",
+ "IRR": "Iranian rial (﷼)",
+ "IRT": "Iranian toman (تومان)",
+ "ISK": "Icelandic króna (kr.)",
+ "JEP": "Jersey pound (£)",
+ "JMD": "Jamaican dollar ($)",
+ "JOD": "Jordanian dinar (د.ا)",
+ "JPY": "Japanese yen (¥)",
+ "KES": "Kenyan shilling (KSh)",
+ "KGS": "Kyrgyzstani som (сом)",
+ "KHR": "Cambodian riel (៛)",
+ "KMF": "Comorian franc (Fr)",
+ "KPW": "North Korean won (₩)",
+ "KRW": "South Korean won (₩)",
+ "KWD": "Kuwaiti dinar (د.ك)",
+ "KYD": "Cayman Islands dollar ($)",
+ "KZT": "Kazakhstani tenge (KZT)",
+ "LAK": "Lao kip (₭)",
+ "LBP": "Lebanese pound (ل.ل)",
+ "LKR": "Sri Lankan rupee (රු)",
+ "LRD": "Liberian dollar ($)",
+ "LSL": "Lesotho loti (L)",
+ "LYD": "Libyan dinar (ل.د)",
+ "MAD": "Moroccan dirham (د.م.)",
+ "MDL": "Moldovan leu (MDL)",
+ "MGA": "Malagasy ariary (Ar)",
+ "MKD": "Macedonian denar (ден)",
+ "MMK": "Burmese kyat (Ks)",
+ "MNT": "Mongolian tögrög (₮)",
+ "MOP": "Macanese pataca (P)",
+ "MRO": "Mauritanian ouguiya (UM)",
+ "MUR": "Mauritian rupee (₨)",
+ "MVR": "Maldivian rufiyaa (.ރ)",
+ "MWK": "Malawian kwacha (MK)",
+ "MXN": "Mexican peso ($)",
+ "MYR": "Malaysian ringgit (RM)",
+ "MZN": "Mozambican metical (MT)",
+ "NAD": "Namibian dollar ($)",
+ "NGN": "Nigerian naira (₦)",
+ "NIO": "Nicaraguan córdoba (C$)",
+ "NOK": "Norwegian krone (kr)",
+ "NPR": "Nepalese rupee (₨)",
+ "NZD": "New Zealand dollar ($)",
+ "OMR": "Omani rial (ر.ع.)",
+ "PAB": "Panamanian balboa (B/.)",
+ "PEN": "Peruvian nuevo sol (S/.)",
+ "PGK": "Papua New Guinean kina (K)",
+ "PHP": "Philippine peso (₱)",
+ "PKR": "Pakistani rupee (₨)",
+ "PLN": "Polish złoty (zł)",
+ "PRB": "Transnistrian ruble (р.)",
+ "PYG": "Paraguayan guaraní (₲)",
+ "QAR": "Qatari riyal (ر.ق)",
+ "RON": "Romanian leu (lei)",
+ "RSD": "Serbian dinar (дин.)",
+ "RUB": "Russian ruble (₽)",
+ "RWF": "Rwandan franc (Fr)",
+ "SAR": "Saudi riyal (ر.س)",
+ "SBD": "Solomon Islands dollar ($)",
+ "SCR": "Seychellois rupee (₨)",
+ "SDG": "Sudanese pound (ج.س.)",
+ "SEK": "Swedish krona (kr)",
+ "SGD": "Singapore dollar ($)",
+ "SHP": "Saint Helena pound (£)",
+ "SLL": "Sierra Leonean leone (Le)",
+ "SOS": "Somali shilling (Sh)",
+ "SRD": "Surinamese dollar ($)",
+ "SSP": "South Sudanese pound (£)",
+ "STD": "São Tomé and Príncipe dobra (Db)",
+ "SYP": "Syrian pound (ل.س)",
+ "SZL": "Swazi lilangeni (L)",
+ "THB": "Thai baht (฿)",
+ "TJS": "Tajikistani somoni (ЅМ)",
+ "TMT": "Turkmenistan manat (m)",
+ "TND": "Tunisian dinar (د.ت)",
+ "TOP": "Tongan paʻanga (T$)",
+ "TRY": "Turkish lira (₺)",
+ "TTD": "Trinidad and Tobago dollar ($)",
+ "TWD": "New Taiwan dollar (NT$)",
+ "TZS": "Tanzanian shilling (Sh)",
+ "UAH": "Ukrainian hryvnia (₴)",
+ "UGX": "Ugandan shilling (UGX)",
+ "USD": "United States dollar ($)",
+ "UYU": "Uruguayan peso ($)",
+ "UZS": "Uzbekistani som (UZS)",
+ "VEF": "Venezuelan bolívar (Bs F)",
+ "VND": "Vietnamese đồng (₫)",
+ "VUV": "Vanuatu vatu (Vt)",
+ "WST": "Samoan tālā (T)",
+ "XAF": "Central African CFA franc (Fr)",
+ "XCD": "East Caribbean dollar ($)",
+ "XOF": "West African CFA franc (Fr)",
+ "XPF": "CFP franc (Fr)",
+ "YER": "Yemeni rial (﷼)",
+ "ZAR": "South African rand (R)",
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/settings.mdx b/docs/apis/rest-api/v2/settings.mdx
new file mode 100644
index 00000000000..67672bf501e
--- /dev/null
+++ b/docs/apis/rest-api/v2/settings.mdx
@@ -0,0 +1,371 @@
+---
+sidebar_position: 25
+sidebar_label: 'Settings'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Settings
+The settings API allows you to view all groups of settings available.
+
+## Setting group properties
+| Attribute | Type | Description |
+| ------------- | ------ | ---------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier that can be used to link settings together. `READ-ONLY` |
+| `label` | string | A human readable label for the setting used in interfaces. `READ-ONLY` |
+| `description` | string | A human readable description for the setting used in interfaces. `READ-ONLY` |
+| `parent_id` | string | ID of parent grouping. `READ-ONLY` |
+| `sub_groups` | string | IDs for settings sub groups. `READ-ONLY` |
+
+## List all settings groups
+This API helps you to view all the settings groups.
+
+```http
+GET /wp-json/wc/v2/settings
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/settings \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("settings")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('settings')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("settings").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("settings").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/shipping-methods.mdx b/docs/apis/rest-api/v2/shipping-methods.mdx
new file mode 100644
index 00000000000..6d209d84b54
--- /dev/null
+++ b/docs/apis/rest-api/v2/shipping-methods.mdx
@@ -0,0 +1,203 @@
+---
+sidebar_position: 24
+sidebar_label: 'Shipping methods'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Shipping methods
+The shipping methods API allows you to view individual shipping methods.
+
+## Shipping method properties
+| Attribute | Type | Description |
+| ------------- | ------ | ---------------------------------------------------------------------- |
+| `id` | string | Method ID. `READ-ONLY` |
+| `title` | string | Shipping method title. `READ-ONLY` |
+| `description` | string | Shipping method description. `READ-ONLY` |
+
+## Retrieve a shipping method
+This API lets you retrieve and view a specific shipping method.
+
+```http
+GET /wp-json/wc/v2/shipping_methods/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/shipping_methods/flat_rate \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("shipping_methods/flat_rate")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping_methods/flat_rate')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping_methods/flat_rate").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping_methods/flat_rate").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping methods
+This API helps you to view all the shipping methods.
+
+```http
+GET /wp-json/wc/v2/shipping_methods
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/shipping_methods \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("shipping_methods")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping_methods')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping_methods").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping_methods").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/shipping-zone-locations.mdx b/docs/apis/rest-api/v2/shipping-zone-locations.mdx
new file mode 100644
index 00000000000..129322d45cb
--- /dev/null
+++ b/docs/apis/rest-api/v2/shipping-zone-locations.mdx
@@ -0,0 +1,241 @@
+---
+sidebar_position: 22
+sidebar_label: 'Shipping zone locations'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Shipping zone locations
+The shipping zone locations API allows you to view and batch update locations of a shipping zone.
+
+## Shipping location properties
+| Attribute | Type | Description |
+| --------- | ------ | ----------------------------------------------------------------------------------------------------------- |
+| `code` | string | Shipping zone location code. |
+| `type` | string | Shipping 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
+GET /wp-json/wc/v2/shipping/zones/<id>/locations
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/shipping/zones/5/locations \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("shipping/zones/5/locations")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones/5/locations')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones/5/locations").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones/5/locations").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a locations of a shipping zone
+This API lets you make changes to locations of a shipping zone.
+
+```http
+PUT /wp-json/wc/v2/shipping/zones/<id>/locations
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+]'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ [
+ 'code' => 'BR:SP',
+ 'type' => 'state'
+ ],
+ [
+ 'code' => 'BR:RJ',
+ 'type' => 'state'
+ ]
+];
+
+print_r($woocommerce->put('shipping/zones/5/locations', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = [
+ {
+ "code": "BR:SP",
+ "type": "state"
+ },
+ {
+ "code": "BR:RJ",
+ "type": "state"
+ }
+]
+
+print(wcapi.put("shipping/zones/5/locations", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = [
+ {
+ code: "BR:SP",
+ type: "state"
+ },
+ {
+ code: "BR:RJ",
+ type: "state"
+ }
+]
+
+woocommerce.put("shipping/zones/5/locations", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/shipping-zone-methods.mdx b/docs/apis/rest-api/v2/shipping-zone-methods.mdx
new file mode 100644
index 00000000000..fe41e80b582
--- /dev/null
+++ b/docs/apis/rest-api/v2/shipping-zone-methods.mdx
@@ -0,0 +1,1032 @@
+---
+sidebar_position: 23
+sidebar_label: 'Shipping zone methods'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------- |
+| `instance_id` | integer | Shipping method instance ID. `READ-ONLY` |
+| `title` | string | Shipping method customer facing title. `READ-ONLY` |
+| `order` | integer | Shipping method sort order. |
+| `enabled` | boolean | Shipping method enabled status. |
+| `method_id` | string | Shipping method ID. `READ-ONLY` `MANDATORY` |
+| `method_title` | string | Shipping method title. `READ-ONLY` |
+| `method_description` | string | Shipping method description. `READ-ONLY` |
+| `settings` | object | Shipping method settings. See [Shipping method - Settings properties](#shipping-method---settings-properties) |
+
+### Shipping method - Settings properties
+| Attribute | Type | Description |
+| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier for the setting. `READ-ONLY` |
+| `label` | string | A human readable label for the setting used in interfaces. `READ-ONLY` |
+| `description` | string | A human readable description for the setting used in interfaces. `READ-ONLY` |
+| `type` | string | Type of setting. Options: `text`, `email`, `number`, `color`, `password`, `textarea`, `select`, `multiselect`, `radio`, `image_width` and `checkbox`. `READ-ONLY` |
+| `value` | string | Setting value. |
+| `default` | string | Default value for the setting. `READ-ONLY` |
+| `tip` | string | Additional help text shown to the user about the setting. `READ-ONLY` |
+| `placeholder` | string | Placeholder 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
+POST /wp-json/wc/v2/shipping/zones/<id>/methods
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'method_id' => 'flat_rate'
+];
+
+print_r($woocommerce->post('shipping/zones/5/methods', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "method_id": "flat_rate"
+}
+
+print(wcapi.post("shipping/zones/5/methods", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ method_id: "flat_rate"
+}
+
+woocommerce.post("shipping/zones/5/methods", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## 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
+GET /wp-json/wc/v2/shipping/zones/<zone_id>/methods/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("shipping/zones/5/methods/26")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones/5/methods/26')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones/5/methods/26").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones/5/methods/26").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping methods from a shipping zone
+This API helps you to view all the shipping methods from a shipping zone.
+
+```http
+GET /wp-json/wc/v2/shipping/zones/<id>/methods
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/shipping/zones/5/methods \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("shipping/zones/5/methods")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones/5/methods')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones/5/methods").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones/5/methods").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a shipping method of a shipping zone
+This API lets you make changes to a shipping method of a shipping zone.
+
+```http
+PUT /wp-json/wc/v2/shipping/zones/<zone_id>/methods/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'regular_price' => [
+ 'cost' => '20.00'
+ ]
+];
+
+print_r($woocommerce->put('shipping/zones/5/methods/26', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "regular_price": {
+ "cost": "20.00"
+ }
+}
+
+print(wcapi.put("shipping/zones/5/methods/26", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ regular_price: {
+ "cost": "20.00"
+ }
+}
+
+woocommerce.put("shipping/zones/5/methods/26", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a shipping method from a shipping zone
+This API helps you delete a shipping method from a shipping zone.
+
+```http
+DELETE /wp-json/wc/v2/shipping/zones/<zone_id>/methods/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/shipping/zones/5/methods/26?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("shipping/zones/5/methods/26", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('shipping/zones/5/methods/26', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("shipping/zones/5/methods/26", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("shipping/zones/5/methods/26", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v2/shipping-zones.mdx b/docs/apis/rest-api/v2/shipping-zones.mdx
new file mode 100644
index 00000000000..b0dea0411f7
--- /dev/null
+++ b/docs/apis/rest-api/v2/shipping-zones.mdx
@@ -0,0 +1,492 @@
+---
+sidebar_position: 21
+sidebar_label: 'Shipping zones'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Shipping zones
+The shipping zones API allows you to create, view, update, and delete individual shipping zones.
+
+## Shipping zone properties
+| Attribute | Type | Description |
+| --------- | ------- | ----------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Shipping zone name. `MANDATORY` |
+| `order` | integer | Shipping zone order. |
+
+## Create a shipping zone
+This API helps you to create a new shipping zone.
+
+```http
+POST /wp-json/wc/v2/shipping/zones
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "Brazil"
+};
+
+WooCommerce.post("shipping/zones", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Brazil'
+];
+
+print_r($woocommerce->post('shipping/zones', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Brazil"
+}
+
+print(wcapi.post("shipping/zones", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Brazil"
+}
+
+woocommerce.post("shipping/zones", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a shipping zone
+This API lets you retrieve and view a specific shipping zone by ID.
+
+```http
+GET /wp-json/wc/v2/shipping/zones/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/shipping/zones/5 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("shipping/zones/5")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones/5')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones/5").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones/5").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping zones
+This API helps you to view all the shipping zones.
+
+```http
+GET /wp-json/wc/v2/shipping/zones
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/shipping/zones \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("shipping/zones")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a shipping zone
+This API lets you make changes to a shipping zone.
+
+```http
+PUT /wp-json/wc/v2/shipping/zones/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ order: 1
+};
+
+WooCommerce.put("shipping/zones/5", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'order' => 1
+];
+
+print_r($woocommerce->put('shipping/zones/5', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "order": 1
+}
+
+print(wcapi.put("shipping/zones/5", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ order: 1
+}
+
+woocommerce.put("shipping/zones/5", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a shipping zone
+This API helps you delete a shipping zone.
+
+```http
+DELETE /wp-json/wc/v2/shipping/zones/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/shipping/zones/5?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("shipping/zones/5", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('shipping/zones/5', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("shipping/zones/5", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("shipping/zones/5", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v2/system-status-tools.mdx b/docs/apis/rest-api/v2/system-status-tools.mdx
new file mode 100644
index 00000000000..8c379433346
--- /dev/null
+++ b/docs/apis/rest-api/v2/system-status-tools.mdx
@@ -0,0 +1,563 @@
+---
+sidebar_position: 28
+sidebar_label: 'System status tools'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# System status tools
+The system status tools API allows you to view and run tools from system status.
+
+## System status tool properties
+| Attribute | Type | Description |
+| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier for the tool. `READ-ONLY` |
+| `name` | string | Tool name. `READ-ONLY` |
+| `action` | string | What running the tool will do. `READ-ONLY` |
+| `description` | string | Tool description. `READ-ONLY` |
+| `success` | boolean | Did the tool run successfully? `READ-ONLY` `WRITE-ONLY` |
+| `message` | string | Tool return message. `READ-ONLY` `WRITE-ONLY` |
+| `confirm` | boolean | Confirm 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
+GET /wp-json/wc/v2/system_status/tools/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/system_status/tools/clear_transients \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("system_status/tools/clear_transients")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('system_status/tools/clear_transients')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("system_status/tools/clear_transients").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("system_status/tools/clear_transients").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all tools from system status
+This API helps you to view all tools from system status.
+
+```http
+GET /wp-json/wc/v2/system_status/tools
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/system_status/tools \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("system_status/tools")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('system_status/tools')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("system_status/tools").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("system_status/tools").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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": "clear_expired_download_permissions",
+ "name": "Used-up download permissions",
+ "action": "Clean up download permissions",
+ "description": "This tool will delete expired download permissions and permissions with 0 remaining downloads.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/clear_expired_download_permissions"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "regenerate_product_lookup_tables",
+ "name": "Product lookup tables",
+ "action": "Regenerate",
+ "description": "This tool will regenerate product lookup table data. This process may take a while.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/regenerate_product_lookup_tables"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "repair_coupons_lookup_table",
+ "name": "Coupons lookup table",
+ "action": "Repair",
+ "description": "This tool will repair the coupons lookup table data with missing discount amounts. This process may take a while.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/repair_coupons_lookup_table"
+ }
+ ],
+ "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": "clear_template_cache",
+ "name": "Clear template cache",
+ "action": "Clear",
+ "description": "<strong class=\"red\">Note:</strong> This tool will empty the template cache.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/clear_template_cache"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "clear_system_status_theme_info_cache",
+ "name": "Clear system status theme info cache",
+ "action": "Clear",
+ "description": "<strong class=\"red\">Note:</strong> This tool will empty the system status theme info cache.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/clear_system_status_theme_info_cache"
+ }
+ ],
+ "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": "regenerate_thumbnails",
+ "name": "Regenerate shop thumbnails",
+ "action": "Regenerate",
+ "description": "This will regenerate all shop thumbnails to match your theme and/or image settings.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/regenerate_thumbnails"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "db_update_routine",
+ "name": "Update database",
+ "action": "Update database",
+ "description": "<strong class=\"red\">Note:</strong> This tool will update your WooCommerce database to the latest version. Please ensure you make sufficient backups before proceeding.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/db_update_routine"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "recreate_order_address_fts_index",
+ "name": "Re-create Order Address FTS index",
+ "action": "Recreate index",
+ "description": "This tool will recreate the full text search index for order addresses. If the index does not exist, it will try to create it.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/recreate_order_address_fts_index"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "verify_db_tables",
+ "name": "Verify base database tables",
+ "action": "Verify database",
+ "description": "Verify if all base database tables are present.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools/verify_db_tables"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/system_status/tools"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Run a tool from system status
+This API lets you run a tool from system status.
+
+```http
+PUT /wp-json/wc/v2/system_status/tools/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'confirm' => true
+];
+
+print_r($woocommerce->put('system_status/tools/clear_transients', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "confirm": True
+}
+
+print(wcapi.put("system_status/tools/clear_transients", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ confirm: true
+}
+
+woocommerce.put("system_status/tools/clear_transients", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/system-status.mdx b/docs/apis/rest-api/v2/system-status.mdx
new file mode 100644
index 00000000000..8cbe3412d54
--- /dev/null
+++ b/docs/apis/rest-api/v2/system-status.mdx
@@ -0,0 +1,303 @@
+---
+sidebar_position: 27
+sidebar_label: 'System status'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# System status
+The system status API allows you to view all system status items.
+
+## System status properties
+| Attribute | Type | Description |
+| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
+| `environment` | object | Environment. See [System status - Environment properties](#system-status---environment-properties) `READ-ONLY` |
+| `database` | object | Database. See [System status - Database properties](#system-status---database-properties) `READ-ONLY` |
+| `active_plugins` | array | Active plugins. `READ-ONLY` |
+| `theme` | object | Theme. See [System status - Theme properties](#system-status---theme-properties) `READ-ONLY` |
+| `settings` | object | Settings. See [System status - Settings properties](#system-status---settings-properties) `READ-ONLY` |
+| `security` | object | Security. See [System status - Security properties](#system-status---security-properties) `READ-ONLY` |
+| `pages` | array | WooCommerce pages. `READ-ONLY` |
+
+### System status - Environment properties
+| Attribute | Type | Description |
+| --------------------------- | ------- | -------------------------------------------------------------------------- |
+| `home_url` | string | Home URL. `READ-ONLY` |
+| `site_url` | string | Site URL. `READ-ONLY` |
+| `wc_version` | string | WooCommerce version. `READ-ONLY` |
+| `log_directory` | string | Log directory. `READ-ONLY` |
+| `log_directory_writable` | boolean | Is log directory writable? `READ-ONLY` |
+| `wp_version` | string | WordPress version. `READ-ONLY` |
+| `wp_multisite` | boolean | Is WordPress multisite? `READ-ONLY` |
+| `wp_memory_limit` | integer | WordPress memory limit. `READ-ONLY` |
+| `wp_debug_mode` | boolean | Is WordPress debug mode active? `READ-ONLY` |
+| `wp_cron` | boolean | Are WordPress cron jobs enabled? `READ-ONLY` |
+| `wp_environment_type` | string | WordPress environment type. `READ-ONLY` |
+| `language` | string | WordPress language. `READ-ONLY` |
+| `server_info` | string | Server info. `READ-ONLY` |
+| `php_version` | string | PHP version. `READ-ONLY` |
+| `php_post_max_size` | integer | PHP post max size. `READ-ONLY` |
+| `php_max_execution_time` | integer | PHP max execution time. `READ-ONLY` |
+| `php_max_input_vars` | integer | PHP max input vars. `READ-ONLY` |
+| `curl_version` | string | cURL version. `READ-ONLY` |
+| `suhosin_installed` | boolean | Is SUHOSIN installed? `READ-ONLY` |
+| `max_upload_size` | integer | Max upload size. `READ-ONLY` |
+| `mysql_version` | string | MySQL version. `READ-ONLY` |
+| `default_timezone` | string | Default timezone. `READ-ONLY` |
+| `fsockopen_or_curl_enabled` | boolean | Is fsockopen/cURL enabled? `READ-ONLY` |
+| `soapclient_enabled` | boolean | Is SoapClient class enabled? `READ-ONLY` |
+| `domdocument_enabled` | boolean | Is DomDocument class enabled? `READ-ONLY` |
+| `gzip_enabled` | boolean | Is GZip enabled? `READ-ONLY` |
+| `mbstring_enabled` | boolean | Is mbstring enabled? `READ-ONLY` |
+| `remote_post_successful` | boolean | Remote POST successful? `READ-ONLY` |
+| `remote_post_response` | string | Remote POST response. `READ-ONLY` |
+| `remote_get_successful` | boolean | Remote GET successful? `READ-ONLY` |
+| `remote_get_response` | string | Remote GET response. `READ-ONLY` |
+
+### System status - Database properties
+| Attribute | Type | Description |
+| ------------------------ | ------ | ----------------------------------------------------------------- |
+| `wc_database_version` | string | WC database version. `READ-ONLY` |
+| `database_prefix` | string | Database prefix. `READ-ONLY` |
+| `maxmind_geoip_database` | string | MaxMind GeoIP database. `READ-ONLY` |
+| `database_tables` | array | Database tables. `READ-ONLY` |
+
+### System status - Theme properties
+| Attribute | Type | Description |
+| ------------------------- | ------- | ------------------------------------------------------------------------------------- |
+| `name` | string | Theme name. `READ-ONLY` |
+| `version` | string | Theme version. `READ-ONLY` |
+| `version_latest` | string | Latest version of theme. `READ-ONLY` |
+| `author_url` | string | Theme author URL. `READ-ONLY` |
+| `is_child_theme` | boolean | Is this theme a child theme? `READ-ONLY` |
+| `has_woocommerce_support` | boolean | Does the theme declare WooCommerce support? `READ-ONLY` |
+| `has_woocommerce_file` | boolean | Does the theme have a woocommerce.php file? `READ-ONLY` |
+| `has_outdated_templates` | boolean | Does this theme have outdated templates? `READ-ONLY` |
+| `overrides` | array | Template overrides. `READ-ONLY` |
+| `parent_name` | string | Parent theme name. `READ-ONLY` |
+| `parent_version` | string | Parent theme version. `READ-ONLY` |
+| `parent_author_url` | string | Parent theme author URL. `READ-ONLY` |
+
+### System status - Settings properties
+| Attribute | Type | Description |
+| --------------------- | ------- | ------------------------------------------------------------------------------------ |
+| `api_enabled` | boolean | REST API enabled? `READ-ONLY` |
+| `force_ssl` | boolean | SSL forced? `READ-ONLY` |
+| `currency` | string | Currency. `READ-ONLY` |
+| `currency_symbol` | string | Currency symbol. `READ-ONLY` |
+| `currency_position` | string | Currency position. `READ-ONLY` |
+| `thousand_separator` | string | Thousand separator. `READ-ONLY` |
+| `decimal_separator` | string | Decimal separator. `READ-ONLY` |
+| `number_of_decimals` | integer | Number of decimals. `READ-ONLY` |
+| `geolocation_enabled` | boolean | Geolocation enabled? `READ-ONLY` |
+| `taxonomies` | array | Taxonomy terms for product/order statuses. `READ-ONLY` |
+
+### System status - Security properties
+| Attribute | Type | Description |
+| ------------------- | ------- | --------------------------------------------------------------------------------- |
+| `secure_connection` | boolean | Is the connection to your store secure? `READ-ONLY` |
+| `hide_errors` | boolean | Hide errors from visitors? `READ-ONLY` |
+
+## List all system status items
+This API helps you to view all the system status items.
+
+```http
+GET /wp-json/wc/v2/system_status
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/system_status \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("system_status")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('system_status')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("system_status").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("system_status").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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,
+ "wp_environment_type": "production",
+ "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": "$",
+ "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
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/tax-classes.mdx b/docs/apis/rest-api/v2/tax-classes.mdx
new file mode 100644
index 00000000000..2affb9422ab
--- /dev/null
+++ b/docs/apis/rest-api/v2/tax-classes.mdx
@@ -0,0 +1,280 @@
+---
+sidebar_position: 18
+sidebar_label: 'Tax classes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Tax classes
+The tax classes API allows you to create, view, and delete individual tax classes.
+
+## Tax class properties
+| Attribute | Type | Description |
+|-----------|--------|-------------------------------------------------------------------------------|
+| `slug` | string | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Tax class name. `REQUIRED` |
+
+## Create a tax class
+This API helps you to create a new tax class.
+
+```http
+POST /wp-json/wc/v2/taxes/classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "Zero Rate"
+};
+
+WooCommerce.post("taxes/classes", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Zero Rate'
+];
+
+print_r($woocommerce->post('taxes/classes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Zero Rate"
+}
+
+print(wcapi.post("taxes/classes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Zero Rate"
+}
+
+woocommerce.post("taxes/classes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "slug": "zero-rate",
+ "name": "Zero Rate",
+ "_links": {
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/taxes/classes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all tax classes
+This API helps you to view all tax classes.
+
+```http
+GET /wp-json/wc/v2/taxes/classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/taxes/classes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("taxes/classes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes/classes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes/classes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes/classes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a tax class
+This API helps you delete a tax class.
+
+:::warning
+This also will delete all tax rates from the selected class.
+:::
+
+```http
+DELETE /wp-json/wc/v2/taxes/classes/<slug>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/taxes/classes/zero-rate?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("taxes/classes/zero-rate", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('taxes/classes/zero-rate', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("taxes/classes/zero-rate", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("taxes/classes/zero-rate", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "slug": "zero-rate",
+ "name": "Zero Rate",
+ "_links": {
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v2/taxes/classes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required to be `true`, since this resource does not support trashing. |
diff --git a/docs/apis/rest-api/v2/taxes.mdx b/docs/apis/rest-api/v2/taxes.mdx
new file mode 100644
index 00000000000..3c003846e70
--- /dev/null
+++ b/docs/apis/rest-api/v2/taxes.mdx
@@ -0,0 +1,4027 @@
+---
+sidebar_position: 17
+sidebar_label: 'Taxes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+| Attribute | Type | Description |
+|------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `country` | string | Country ISO 3166 code. See [ISO 3166 Codes (Countries)](http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html) for more details |
+| `state` | string | State code. |
+| `postcode` | string | Postcode/ZIP. |
+| `city` | string | City name. |
+| `rate` | string | Tax rate. |
+| `name` | string | Tax rate name. |
+| `priority` | integer | Tax 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`. |
+| `compound` | boolean | Whether or not this is a compound rate. Compound tax rates are applied on top of other tax rates. Default is `false`. |
+| `shipping` | boolean | Whether or not this tax rate also gets applied to shipping. Default is `true`. |
+| `order` | integer | Indicates the order that will appear in queries. |
+| `class` | string | Tax class. Default is `standard`. |
+
+## Create a tax rate
+This API helps you to create a new tax rate.
+
+```http
+POST /wp-json/wc/v2/taxes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'country' => 'US',
+ 'state' => 'AL',
+ 'rate' => '4',
+ 'name' => 'State Tax',
+ 'shipping' => false
+];
+
+print_r($woocommerce->post('taxes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "country": "US",
+ "state": "AL",
+ "rate": "4",
+ "name": "State Tax",
+ "shipping": False
+}
+
+print(wcapi.post("taxes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ country: "US",
+ state: "AL",
+ rate: "4",
+ name: "State Tax",
+ shipping: false
+}
+
+woocommerce.post("taxes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a tax rate
+This API lets you retrieve and view a specific tax rate by ID.
+
+```http
+GET /wp-json/wc/v2/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/taxes/72 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("taxes/72")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes/72')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes/72").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes/72").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all tax rates
+This API helps you to view all the tax rates.
+
+```http
+GET /wp-json/wc/v2/taxes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/taxes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("taxes")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|------------|---------|--------------------------------------------------------------------------------------------------------------------------------------------|
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `name`. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. |
+| `class` | string | Sort by tax class. |
+
+## Update a tax rate
+This API lets you make changes to a tax rate.
+
+```http
+PUT /wp-json/wc/v2/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: "US Tax"
+};
+
+WooCommerce.put("taxes/72", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'US Tax'
+];
+
+print_r($woocommerce->put('taxes/72', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "US Tax"
+}
+
+print(wcapi.put("taxes/72", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "US Tax"
+}
+
+woocommerce.put("taxes/72", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a tax rate
+This API helps you delete a tax rate.
+
+```http
+DELETE /wp-json/wc/v2/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/taxes/72?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("taxes/72", {
+ force: true
+})
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('taxes/72', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("taxes/72", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("taxes/72", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|---------------------------------------------------------------|
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/taxes/batch
+```
+
+> Example batch creating all US taxes:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v2/webhooks.mdx b/docs/apis/rest-api/v2/webhooks.mdx
new file mode 100644
index 00000000000..3f716c69864
--- /dev/null
+++ b/docs/apis/rest-api/v2/webhooks.mdx
@@ -0,0 +1,1179 @@
+---
+sidebar_position: 19
+sidebar_label: 'Webhooks'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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](https://docs.woocommerce.com/document/webhooks/) for more details.
+
+## Webhook properties
+| Attribute | Type | Description |
+| ------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | A friendly name for the webhook. |
+| `status` | string | Webhook status. Options: `active`, `paused` and `disabled`. Default is `active`. |
+| `topic` | string | Webhook topic. `MANDATORY` |
+| `resource` | string | Webhook resource. `READ-ONLY` |
+| `event` | string | Webhook event. `READ-ONLY` |
+| `hooks` | array | WooCommerce action names associated with the webhook. `READ-ONLY` |
+| `delivery_url` | string | The URL where the webhook payload is delivered. `READ-ONLY` `MANDATORY` |
+| `secret` | string | 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. `WRITE-ONLY` `MANDATORY` |
+| `date_created` | date-time | The date the webhook was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the webhook was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the webhook was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the webhook was last modified, as GMT. `READ-ONLY` |
+
+### Webhook delivery properties
+| Attribute | Type | Description |
+| ------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `duration` | string | The delivery duration, in seconds. `READ-ONLY` |
+| `summary` | string | A friendly summary of the response including the HTTP response code, message, and body. `READ-ONLY` |
+| `request_url` | string | The URL where the webhook was delivered. `READ-ONLY` |
+| `request_headers` | array | Request headers. `READ-ONLY` |
+| `request_body` | string | Request body. `READ-ONLY` |
+| `response_code` | string | The HTTP response code from the receiving server. `READ-ONLY` |
+| `response_message` | string | The HTTP response message from the receiving server. `READ-ONLY` |
+| `response_headers` | array | Array of the response headers from the receiving server. `READ-ONLY` |
+| `response_body` | string | The response body from the receiving server. `READ-ONLY` |
+| `date_created` | date-time | The date the webhook delivery was logged, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the webhook delivery was logged, GMT. `READ-ONLY` |
+
+#### Request header properties
+| Attribute | Type | Description |
+|----------------------------|---------|--------------------------------------------------------------------------------------------------------------------------------------|
+| `User-Agent` | string | The request user agent, default is "WooCommerce/\{version\} Hookshot (WordPress/\{version\})". `READ-ONLY` |
+| `Content-Type` | string | The request content-type, default is "application/json". `READ-ONLY` |
+| `X-WC-Webhook-Source` | string | The webhook source. `READ-ONLY` |
+| `X-WC-Webhook-Topic` | string | The webhook topic. `READ-ONLY` |
+| `X-WC-Webhook-Resource` | string | The webhook resource. `READ-ONLY` |
+| `X-WC-Webhook-Event` | string | The webhook event. `READ-ONLY` |
+| `X-WC-Webhook-Signature` | string | A base64 encoded HMAC-SHA256 hash of the payload. `READ-ONLY` |
+| `X-WC-Webhook-ID` | integer | The webhook's ID. `READ-ONLY` |
+| `X-WC-Webhook-Delivery-ID` | integer | The delivery ID. `READ-ONLY` |
+
+## Create a webhook
+This API helps you to create a new webhook.
+
+```http
+POST /wp-json/wc/v2/webhooks
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Order updated',
+ 'topic' => 'order.updated',
+ 'delivery_url' => 'http://requestb.in/1g0sxmo1'
+];
+
+print_r($woocommerce->post('webhooks', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Order updated",
+ "topic": "order.updated",
+ "delivery_url": "http://requestb.in/1g0sxmo1"
+}
+
+print(wcapi.post("webhooks", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Order updated",
+ topic: "order.updated",
+ delivery_url: "http://requestb.in/1g0sxmo1"
+}
+
+woocommerce.post("webhooks", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a webhook
+This API lets you retrieve and view a specific webhook.
+
+```http
+GET /wp-json/wc/v2/webhooks/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/webhooks/142 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("webhooks/142")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks/142')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks/142").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks/142").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all webhooks
+This API helps you to view all the webhooks.
+
+```http
+GET /wp-json/wc/v2/webhooks
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/webhooks \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("webhooks")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+| --------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `status` | string | Limit 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
+PUT /wp-json/wc/v2/webhook/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ status: "paused"
+}
+
+WooCommerce.put("webhooks/142", data)
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'status' => 'paused'
+];
+
+print_r($woocommerce->put('webhooks/142', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "status": "paused"
+}
+
+print(wcapi.put("webhooks/142", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ status: "paused"
+}
+
+woocommerce.put("webhooks/142", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a webhook
+This API helps you delete a webhook.
+
+```http
+DELETE /wp-json/wc/v2/webhooks/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v2/webhooks/142 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete("webhooks/142")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('webhooks/142')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("webhooks/142").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("webhooks/142").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+| Parameter | Type | Description |
+|-----------|--------|----------------------------------------------------------------------------|
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or deleted.
+:::
+
+```http
+POST /wp-json/wc/v2/webhooks/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve webhook delivery
+This API lets you retrieve and view a specific webhook delivery.
+
+```http
+GET /wp-json/wc/v2/webhooks/<id>/deliveries/<delivery_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/webhooks/142/deliveries/54 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("webhooks/142/deliveries/54")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks/142/deliveries/54')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks/142/deliveries/54").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks/142/deliveries/54").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+:::note
+View the <a href="#webhooks-delivery-properties">Webhooks Delivery properties</a> for more details on this response.
+:::
+
+## List all webhook deliveries
+This API helps you to view all deliveries from a specific webhooks.
+
+```http
+GET /wp-json/wc/v2/webhooks/<id>/deliveries
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v2/webhooks/142/deliveries \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get("webhooks/142/deliveries")
+ .then((response) => {
+ console.log(response.data);
+ })
+ .catch((error) => {
+ console.log(error.response.data);
+ });
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks/142/deliveries')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks/142/deliveries").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks/142/deliveries").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/_category_.json b/docs/apis/rest-api/v3/_category_.json
new file mode 100644
index 00000000000..4b565199531
--- /dev/null
+++ b/docs/apis/rest-api/v3/_category_.json
@@ -0,0 +1,4 @@
+{
+ "label": "v3 (current)",
+ "position": 3
+}
diff --git a/docs/apis/rest-api/v3/api-reference.mdx b/docs/apis/rest-api/v3/api-reference.mdx
new file mode 100644
index 00000000000..b8293f6f316
--- /dev/null
+++ b/docs/apis/rest-api/v3/api-reference.mdx
@@ -0,0 +1,8964 @@
+---
+sidebar_position: 0
+sidebar_label: 'API Reference'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Index
+
+By default, the API provides information about all available endpoints on the site. Authentication is not required to access the API index.
+
+```http
+GET /wp-json/wc/v3
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( '' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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", "string" ]
+ },
+ "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", "string" ]
+ },
+ "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", "string" ]
+ },
+ "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/"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/coupons.mdx b/docs/apis/rest-api/v3/coupons.mdx
new file mode 100644
index 00000000000..35d06e3367b
--- /dev/null
+++ b/docs/apis/rest-api/v3/coupons.mdx
@@ -0,0 +1,1077 @@
+---
+sidebar_position: 1
+sidebar_label: 'Coupons'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Coupons
+
+The coupons API allows you to create, view, update, and delete individual, or a batch, of coupon codes.
+
+## Coupon properties
+
+| Attribute | Type | Description |
+| ----------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------ |
+| `id` | integer | Unique identifier for the object. `READ-ONLY` |
+| `code` | string | Coupon code. `MANDATORY` |
+| `amount` | string | The amount of discount. Should always be numeric, even if setting a percentage. |
+| `date_created` | date-time | The date the coupon was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the coupon was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the coupon was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the coupon was last modified, as GMT. `READ-ONLY` |
+| `discount_type` | string | Determines the type of discount that will be applied. Options: `percent`, `fixed_cart` and `fixed_product`. Default is `fixed_cart`. |
+| `description` | string | Coupon description. |
+| `date_expires` | string | The date the coupon expires, in the site's timezone. |
+| `date_expires_gmt` | string | The date the coupon expires, as GMT. |
+| `usage_count` | integer | Number of times the coupon has been used already. `READ-ONLY` |
+| `individual_use` | boolean | If true, the coupon can only be used individually. Other applied coupons will be removed from the cart. Default is `false`. |
+| `product_ids` | array | List of product IDs the coupon can be used on. |
+| `excluded_product_ids` | array | List of product IDs the coupon cannot be used on. |
+| `usage_limit` | integer | How many times the coupon can be used in total. |
+| `usage_limit_per_user` | integer | How many times the coupon can be used per customer. |
+| `limit_usage_to_x_items` | integer | Max number of items in the cart the coupon can be applied to. |
+| `free_shipping` | boolean | If true and if the free shipping method requires a coupon, this coupon will enable free shipping. Default is `false`. |
+| `product_categories` | array | List of category IDs the coupon applies to. |
+| `excluded_product_categories` | array | List of category IDs the coupon does not apply to. |
+| `exclude_sale_items` | boolean | If true, this coupon will not be applied to items that have sale prices. Default is `false`. |
+| `minimum_amount` | string | Minimum order amount that needs to be in the cart before coupon applies. |
+| `maximum_amount` | string | Maximum order amount allowed when using the coupon. |
+| `email_restrictions` | array | List of email addresses that can use this coupon. |
+| `used_by` | array | List of user IDs (or guest email addresses) that have used the coupon. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Coupon - Meta data properties](#coupon---meta-data-properties) |
+
+### Coupon - Meta data properties
+
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+## Create a coupon
+
+This API helps you to create a new coupon.
+
+```http
+POST /wp-json/wc/v3/coupons
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a coupon
+
+This API lets you retrieve and view a specific coupon by ID.
+
+```http
+GET /wp-json/wc/v3/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/coupons/719 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'coupons/719' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('coupons/719')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("coupons/719").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("coupons/719").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all coupons
+
+This API helps you to list all the coupons that have been created.
+
+```http
+GET /wp-json/wc/v3/coupons
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/coupons \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'coupons' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('coupons')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("coupons").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("coupons").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `modified_after` | string | Limit response to resources modified after a given ISO8601 compliant date. |
+| `modified_before` | string | Limit response to resources modified after a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Whether to interpret dates as GMT when limiting response by published or modified date. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `code` | string | Limit result set to resources with a specific code. |
+
+## Update a coupon
+
+This API lets you make changes to a coupon.
+
+```http
+PUT /wp-json/wc/v3/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ amount: '5',
+};
+
+WooCommerce.put( 'coupons/719', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'amount' => '5'
+];
+
+print_r($woocommerce->put('coupons/719', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "amount": "5"
+}
+
+print(wcapi.put("coupons/719", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ amount: "5"
+}
+
+woocommerce.put("coupons/719", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a coupon
+
+This API helps you delete a coupon.
+
+```http
+DELETE /wp-json/wc/v3/coupons/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/coupons/719?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'coupons/719', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('coupons/719', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("coupons/719", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("coupons/719", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------------------ |
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/coupons/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/customers.mdx b/docs/apis/rest-api/v3/customers.mdx
new file mode 100644
index 00000000000..630402fd67d
--- /dev/null
+++ b/docs/apis/rest-api/v3/customers.mdx
@@ -0,0 +1,1680 @@
+---
+sidebar_position: 2
+sidebar_label: 'Customers'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Customers
+
+The customer API allows you to create, view, update, and delete individual, or a batch, of customers.
+
+## Customer properties
+
+| Attribute | Type | Description |
+| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the customer was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the customer was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the customer was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the customer was last modified, as GMT. `READ-ONLY` |
+| `email` | string | The email address for the customer. `MANDATORY` |
+| `first_name` | string | Customer first name. |
+| `last_name` | string | Customer last name. |
+| `role` | string | Customer role. `READ-ONLY` |
+| `username` | string | Customer login name. |
+| `password` | string | Customer password. `WRITE-ONLY` |
+| `billing` | object | List of billing address data. See [Customer - Billing properties](#customer---billing-properties) |
+| `shipping` | object | List of shipping address data. See [Customer - Shipping properties](#customer---shipping-properties) |
+| `is_paying_customer` | bool | Is the customer a paying customer? `READ-ONLY` |
+| `avatar_url` | string | Avatar URL. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Customer - Meta data properties](#customer---meta-data-properties) |
+
+### Customer - Billing properties
+
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1 |
+| `address_2` | string | Address line 2 |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | ISO code of the country. |
+| `email` | string | Email address. |
+| `phone` | string | Phone number. |
+
+### Customer - Shipping properties
+
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1 |
+| `address_2` | string | Address line 2 |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | ISO code of the country. |
+
+### Customer - Meta data properties
+
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+## Create a customer
+
+This API helps you to create a new customer.
+
+```http
+POST /wp-json/wc/v3/customers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a customer
+
+This API lets you retrieve and view a specific customer by ID.
+
+```http
+GET /wp-json/wc/v3/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/customers/25 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'customers/25' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers/25')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers/25").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers/25").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all customers
+
+This API helps you to view all the customers.
+
+```http
+GET /wp-json/wc/v3/customers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/customers \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'customers' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific IDs. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `id`, `include`, `name` and `registered_date`. Default is `name`. |
+| `email` | string | Limit result set to resources with a specific email. |
+| `role` | string | Limit 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
+PUT /wp-json/wc/v3/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'first_name' => 'James',
+ 'billing' => [
+ 'first_name' => 'James'
+ ],
+ 'shipping' => [
+ 'first_name' => 'James'
+ ]
+];
+
+print_r($woocommerce->put('customers/25', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "first_name": "James",
+ "billing": {
+ "first_name": "James"
+ },
+ "shipping": {
+ "first_name": "James"
+ }
+}
+
+print(wcapi.put("customers/25", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ first_name: "James",
+ billing: {
+ first_name: "James"
+ },
+ shipping: {
+ first_name: "James"
+ }
+}
+
+woocommerce.put("customers/25", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a customer
+
+This API helps you delete a customer.
+
+```http
+DELETE /wp-json/wc/v3/customers/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/customers/25?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'customers/25', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('customers/25', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("customers/25", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("customers/25", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ---------- | ------- | ------------------------------------------------------------- |
+| `force` | string | Required to be `true`, as resource does not support trashing. |
+| `reassign` | integer | User ID to reassign posts to. |
+
+## Batch update customers
+
+This API helps you to batch create, update and delete multiple customers.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/customers/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve customer downloads
+
+This API lets you retrieve customer downloads permissions.
+
+```http
+GET /wp-json/wc/v3/customers/<id>/downloads
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/customers/26/downloads \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'customers/26/downloads' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('customers/26/downloads')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("customers/26/downloads").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("customers/26/downloads").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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 – 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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+### Customer downloads properties
+
+| Attribute | Type | Description |
+| --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
+| `download_id` | string | Download ID (MD5). `READ-ONLY` |
+| `download_url` | string | Download file URL. `READ-ONLY` |
+| `product_id` | integer | Downloadable product ID. `READ-ONLY` |
+| `product_name` | string | Product name. `READ-ONLY` |
+| `download_name` | string | Downloadable file name. `READ-ONLY` |
+| `order_id` | integer | Order ID. `READ-ONLY` |
+| `order_key` | string | Order key. `READ-ONLY` |
+| `downloads_remaining` | string | Number of downloads remaining. `READ-ONLY` |
+| `access_expires` | string | The date when download access expires, in the site's timezone. `READ-ONLY` |
+| `access_expires_gmt` | string | The date when download access expires, as GMT. `READ-ONLY` |
+| `file` | object | File details. `READ-ONLY` See [Customers downloads - File properties](#customer-downloads---file-properties) |
+
+### Customer downloads - File properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ---------------------------------------------------- |
+| `name` | string | File name. `READ-ONLY` |
+| `file` | string | File URL. `READ-ONLY` |
diff --git a/docs/apis/rest-api/v3/data.mdx b/docs/apis/rest-api/v3/data.mdx
new file mode 100644
index 00000000000..4d9421ddaf8
--- /dev/null
+++ b/docs/apis/rest-api/v3/data.mdx
@@ -0,0 +1,1353 @@
+---
+sidebar_position: 30
+sidebar_label: 'Data'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+GET /wp-json/wc/v3/data
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/data \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'data' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('data')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("data").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("data").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Data properties
+
+| Attribute | Type | Description |
+| ------------- | ------ | -------------------------------------------------------------------- |
+| `slug` | string | Data resource ID. `READ-ONLY` |
+| `description` | string | Data resource description. `READ-ONLY` |
+
+## List all continents
+
+This API helps you to view all the continents.
+
+```http
+GET /wp-json/wc/v3/data/continents
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/data/continents \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'data/continents' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('data/continents'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("data/continents").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("data/continents").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Continents properties
+
+| Attribute | Type | Description |
+| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `code` | string | 2 character continent code. `READ-ONLY` |
+| `name` | string | Full name of continent. `READ-ONLY` |
+| `countries` | array | List of countries on this continent. See [Continents - Countries properties](#continents---countries-properties) `READ-ONLY` |
+
+##### Continents - Countries properties
+
+| Attribute | Type | Description |
+| ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `code` | string | ISO3166 alpha-2 country code. `READ-ONLY` |
+| `currency_code` | string | Default ISO4127 alpha-3 currency code for the country. `READ-ONLY` |
+| `currency_pos` | string | Currency symbol position for this country. `READ-ONLY` |
+| `decimal_sep` | string | Decimal separator for displayed prices for this country. `READ-ONLY` |
+| `dimension_unit` | string | The unit lengths are defined in for this country. `READ-ONLY` |
+| `name` | string | Full name of country. `READ-ONLY` |
+| `num_decimals` | integer | Number of decimal points shown in displayed prices for this country. `READ-ONLY` |
+| `states` | array | List of states in this country. See [Continents - Countries - States properties](#continents---countries---states-properties) `READ-ONLY` |
+| `thousand_sep` | string | Thousands separator for displayed prices in this country. `READ-ONLY` |
+| `weight_unit` | string | The unit weights are defined in for this country. `READ-ONLY` |
+
+##### Continents - Countries - States properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `code` | string | State code. `READ-ONLY` |
+| `name` | string | Full name of state. `READ-ONLY` |
+
+## Retrieve continent data
+
+This API lets you retrieve and view a continent data.
+
+```http
+GET /wp-json/wc/v3/data/continents/<location>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/data/continents/eu \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'data/continents/eu' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('data/continents/eu'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("data/continents/eu").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("data/continents/eu").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "code": "EU",
+ "name": "Europe",
+ "countries": [
+ {
+ "code": "AD",
+ "name": "Andorra",
+ "states": []
+ },
+ {
+ "code": "AL",
+ "name": "Albania",
+ "states": []
+ },
+ {
+ "code": "AT",
+ "name": "Austria",
+ "states": []
+ },
+ {
+ "code": "AX",
+ "name": "Å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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Continent properties
+
+See [list of continents properties](#continents-properties).
+
+## List all countries
+
+This API helps you to view all the countries.
+
+```http
+GET /wp-json/wc/v3/data/countries
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/data/countries \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'data/countries' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('data/countries'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("data/countries").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("data/countries").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Countries properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
+| `code` | string | ISO3166 alpha-2 country code. `READ-ONLY` |
+| `name` | string | Full name of country. `READ-ONLY` |
+| `states` | array | List of states in this country. See [Countries - States properties](#countries---states-properties) `READ-ONLY` |
+
+##### Countries - States properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `code` | string | State code. `READ-ONLY` |
+| `name` | string | Full name of state. `READ-ONLY` |
+
+## Retrieve country data
+
+This API lets you retrieve and view a country data.
+
+```http
+GET /wp-json/wc/v3/data/countries/<location>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/data/countries/br \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'data/countries/br' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('data/countries/br'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("data/countries/br").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("data/countries/br").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "code": "BR",
+ "name": "Brazil",
+ "states": [
+ {
+ "code": "AC",
+ "name": "Acre"
+ },
+ {
+ "code": "AL",
+ "name": "Alagoas"
+ },
+ {
+ "code": "AP",
+ "name": "Amapá"
+ },
+ {
+ "code": "AM",
+ "name": "Amazonas"
+ },
+ {
+ "code": "BA",
+ "name": "Bahia"
+ },
+ {
+ "code": "CE",
+ "name": "Ceará"
+ },
+ {
+ "code": "DF",
+ "name": "Distrito Federal"
+ },
+ {
+ "code": "ES",
+ "name": "Espírito Santo"
+ },
+ {
+ "code": "GO",
+ "name": "Goiás"
+ },
+ {
+ "code": "MA",
+ "name": "Maranhão"
+ },
+ {
+ "code": "MT",
+ "name": "Mato Grosso"
+ },
+ {
+ "code": "MS",
+ "name": "Mato Grosso do Sul"
+ },
+ {
+ "code": "MG",
+ "name": "Minas Gerais"
+ },
+ {
+ "code": "PA",
+ "name": "Pará"
+ },
+ {
+ "code": "PB",
+ "name": "Paraíba"
+ },
+ {
+ "code": "PR",
+ "name": "Paraná"
+ },
+ {
+ "code": "PE",
+ "name": "Pernambuco"
+ },
+ {
+ "code": "PI",
+ "name": "Piauí"
+ },
+ {
+ "code": "RJ",
+ "name": "Rio de Janeiro"
+ },
+ {
+ "code": "RN",
+ "name": "Rio Grande do Norte"
+ },
+ {
+ "code": "RS",
+ "name": "Rio Grande do Sul"
+ },
+ {
+ "code": "RO",
+ "name": "Rondônia"
+ },
+ {
+ "code": "RR",
+ "name": "Roraima"
+ },
+ {
+ "code": "SC",
+ "name": "Santa Catarina"
+ },
+ {
+ "code": "SP",
+ "name": "Sã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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Country properties
+
+See [list of countries properties](#countries-properties).
+
+## List all currencies
+
+This API helps you to view all the currencies.
+
+```http
+GET /wp-json/wc/v3/data/currencies
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/data/currencies \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'data/currencies' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('data/currencies'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("data/currencies").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("data/currencies").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "code": "BTC",
+ "name": "Bitcoin",
+ "symbol": "฿",
+ "_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": "€",
+ "_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": "$",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/data/currencies/USD"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/data/currencies"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Currencies properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ---------------------------------------------------------------- |
+| `code` | string | ISO4217 currency code. `READ-ONLY` |
+| `name` | string | Full name of currency. `READ-ONLY` |
+| `symbol` | string | Currency symbol. `READ-ONLY` |
+
+## Retrieve currency data
+
+This API lets you retrieve and view a currency data.
+
+```http
+GET /wp-json/wc/v3/data/currencies/<currency>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/data/currencies/brl \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'data/currencies/brl' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('data/currencies/brl'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("data/currencies/brl").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("data/currencies/brl").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "code": "BRL",
+ "name": "Brazilian real",
+ "symbol": "R$",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/data/currencies/BRL"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/data/currencies"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Currency properties
+
+See [list of currencies properties](#currencies-properties).
+
+## Retrieve current currency
+
+This API lets you retrieve and view store's current currency data.
+
+```http
+GET /wp-json/wc/v3/data/currencies/current
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/data/currencies/current \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'data/currencies/current' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('data/currencies/current'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("data/currencies/current").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("data/currencies/current").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "code": "USD",
+ "name": "United States (US) dollar",
+ "symbol": "$",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/data/currencies/USD"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/data/currencies"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Currency properties
+
+See [list of currencies properties](#currencies-properties).
diff --git a/docs/apis/rest-api/v3/images/woocommerce-api-key-generated.png b/docs/apis/rest-api/v3/images/woocommerce-api-key-generated.png
new file mode 100644
index 00000000000..705d505d3ef
Binary files /dev/null and b/docs/apis/rest-api/v3/images/woocommerce-api-key-generated.png differ
diff --git a/docs/apis/rest-api/v3/images/woocommerce-api-keys-settings.png b/docs/apis/rest-api/v3/images/woocommerce-api-keys-settings.png
new file mode 100644
index 00000000000..51ff26b433e
Binary files /dev/null and b/docs/apis/rest-api/v3/images/woocommerce-api-keys-settings.png differ
diff --git a/docs/apis/rest-api/v3/images/woocommerce-auth-endpoint-example.png b/docs/apis/rest-api/v3/images/woocommerce-auth-endpoint-example.png
new file mode 100644
index 00000000000..d10d2413952
Binary files /dev/null and b/docs/apis/rest-api/v3/images/woocommerce-auth-endpoint-example.png differ
diff --git a/docs/apis/rest-api/v3/images/woocommerce-auth-endpoint-flow.png b/docs/apis/rest-api/v3/images/woocommerce-auth-endpoint-flow.png
new file mode 100644
index 00000000000..82907e81a84
Binary files /dev/null and b/docs/apis/rest-api/v3/images/woocommerce-auth-endpoint-flow.png differ
diff --git a/docs/apis/rest-api/v3/images/woocommerce-creating-api-keys.png b/docs/apis/rest-api/v3/images/woocommerce-creating-api-keys.png
new file mode 100644
index 00000000000..aa06315fe6d
Binary files /dev/null and b/docs/apis/rest-api/v3/images/woocommerce-creating-api-keys.png differ
diff --git a/docs/apis/rest-api/v3/index.mdx b/docs/apis/rest-api/v3/index.mdx
new file mode 100644
index 00000000000..7899dfdf1ca
--- /dev/null
+++ b/docs/apis/rest-api/v3/index.mdx
@@ -0,0 +1,11 @@
+---
+title: REST API v3
+slug: /apis/rest-api/v3
+sidebar_position: 0
+---
+
+import DocCardList from '@theme/DocCardList';
+
+The current and recommended version of the WooCommerce REST API. Use `/wp-json/wc/v3/` endpoints for all new integrations.
+
+<DocCardList />
diff --git a/docs/apis/rest-api/v3/order-actions.mdx b/docs/apis/rest-api/v3/order-actions.mdx
new file mode 100644
index 00000000000..5d6d79b29c3
--- /dev/null
+++ b/docs/apis/rest-api/v3/order-actions.mdx
@@ -0,0 +1,287 @@
+---
+sidebar_position: 4
+sidebar_label: 'Order Actions'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Order actions
+
+The order actions API allows you to perform specific actions with existing orders like you can from the Edit Order screen in the web app.
+
+_Note: currently only some actions are available, other actions will be introduced at a later time._
+
+## Send order details to customer
+
+This endpoint allows you to trigger an email to the customer with the details of their order. In case the order doesn't yet have a billing email set, you can specify an email recipient. However, if the order does have an existing billing email, this will return an error, unless you also specify that the existing email should be overwritten by using the `force_email_update` parameter.
+
+```http
+POST /wp-json/wc/v3/orders/<id>/actions/send_order_details
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X POST https://example.com/wp-json/wc/v3/orders/723/actions/send_order_details \
+ -u consumer_key:consumer_secret \
+ -d '{
+ "email": "somebody@example.com",
+ "force_email_update": true
+ }'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ email: 'somebody@example.com',
+ force_email_update: true,
+};
+
+WooCommerce.post( 'orders/723/actions/send_order_details', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'email' => 'somebody@example.com',
+ 'force_email_update' => true,
+];
+
+print_r($woocommerce->post('orders/723/actions/send_order_details', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "email": "somebody@example.com",
+ "force_email_update": true
+}
+
+print(wcapi.post("orders/723/actions/send_order_details", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ "email": "somebody@example.com",
+ "force_email_update": true
+}
+
+woocommerce.post("orders/723/actions/send_order_details", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "message": "Billing email updated to somebody@example.com. Order details sent to somebody@example.com, via REST API."
+}
+```
+
+ </TabItem>
+</Tabs>
+
+```json
+{
+ "code": "woocommerce_rest_missing_email",
+ "message": "Order does not have an email address.",
+ "data": {
+ "status": 400
+ }
+}
+```
+
+## Send order notification email to customer
+
+This endpoint allows you to trigger an email to a customer about the status of their order. This is similar to the [`send_order_details`](#send-order-details-to-customer) endpoint, but allows you to specify which email template to send, based on which email templates are relevant to the order. For example, an order that is on hold has the `customer_on_hold_order` template available. A completed order that also has a partial refund has both the `customer_completed_order` and `customer_refunded_order` templates available. Specifying the `customer_invoice` template is the same as using the `send_order_details` endpoint.
+
+```http
+POST /wp-json/wc/v3/orders/<id>/actions/send_email
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X POST https://example.com/wp-json/wc/v3/orders/723/actions/send_email \
+ -u consumer_key:consumer_secret \
+ -d '{
+ "template_id": "customer_completed_order",
+ "email": "somebody@example.com",
+ "force_email_update": true
+ }'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ template_id: 'customer_completed_order',
+ email: 'somebody@example.com',
+ force_email_update: true,
+};
+
+WooCommerce.post( 'orders/723/actions/send_email', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'template_id' => 'customer_completed_order',
+ 'email' => 'somebody@example.com',
+ 'force_email_update' => true,
+];
+
+print_r($woocommerce->post('orders/723/actions/send_email', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "template_id": "customer_completed_order",
+ "email": "somebody@example.com",
+ "force_email_update": true
+}
+
+print(wcapi.post("orders/723/actions/send_email", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ "template_id": "customer_completed_order",
+ "email": "somebody@example.com",
+ "force_email_update": true
+}
+
+woocommerce.post("orders/723/actions/send_email", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "message": "Billing email updated to somebody@example.com. Email template "Completed order" sent to somebody@example.com, via REST API."
+}
+```
+
+ </TabItem>
+</Tabs>
+
+```json
+{
+ "code": "woocommerce_rest_invalid_email_template",
+ "message": "customer_completed_order is not a valid template for this order.",
+ "data": {
+ "status": 400
+ }
+}
+```
+
+## Get available email templates for an order
+
+This endpoint allows you to retrieve a list of email templates that are available for the specified order. You can also get this data embedded in the response for the [`orders` endpoint](../orders#list-all-orders).
+
+```http
+GET /wp-json/wc/v3/orders/<id>/actions/email_templates
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X GET https://example.com/wp-json/wc/v3/orders/723/actions/email_templates \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'orders/723/actions/email_templates' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('orders/723/actions/email_templates'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/actions/email_templates").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.post("orders/723/actions/email_templates").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "id": "customer_completed_order",
+ "title": "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."
+ },
+ {
+ "id": "customer_invoice",
+ "title": "Order details",
+ "description": "Order detail emails can be sent to customers containing their order information and payment links."
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/order-notes.mdx b/docs/apis/rest-api/v3/order-notes.mdx
new file mode 100644
index 00000000000..03caea62da1
--- /dev/null
+++ b/docs/apis/rest-api/v3/order-notes.mdx
@@ -0,0 +1,449 @@
+---
+sidebar_position: 5
+sidebar_label: 'Order Notes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+
+| Attribute | Type | Description |
+| ------------------ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `author` | string | Order note author. `READ-ONLY` |
+| `date_created` | date-time | The date the order note was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the order note was created, as GMT. `READ-ONLY` |
+| `note` | string | Order note content. `MANDATORY` |
+| `customer_note` | boolean | If 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_user` | boolean | If 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
+POST /wp-json/wc/v3/orders/<id>/notes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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!!!"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ note: 'Order ok!!!',
+};
+
+WooCommerce.post( 'orders/723/notes', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'note' => 'Order ok!!!'
+];
+
+print_r($woocommerce->post('orders/723/notes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "note": "Order ok!!!"
+}
+
+print(wcapi.post("orders/723/notes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ note: "Order ok!!!"
+}
+
+woocommerce.post("orders/723/notes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an order note
+
+This API lets you retrieve and view a specific note from an order.
+
+```http
+GET /wp-json/wc/v3/orders/<id>/notes/<note_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/orders/723/notes/281 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'orders/723/notes/281' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/723/notes/281')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/notes/281").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/723/notes/281").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all order notes
+
+This API helps you to view all the notes from an order.
+
+```http
+GET /wp-json/wc/v3/orders/<id>/notes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/orders/723/notes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'orders/723/notes' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/723/notes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/notes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/723/notes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `type` | string | Limit 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
+DELETE /wp-json/wc/v3/orders/<id>/notes/<note_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/orders/723/notes/281?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'orders/723/notes/281', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/723/notes/281', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/723/notes/281", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/723/notes/281", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v3/order-refunds.mdx b/docs/apis/rest-api/v3/order-refunds.mdx
new file mode 100644
index 00000000000..d70eb87931e
--- /dev/null
+++ b/docs/apis/rest-api/v3/order-refunds.mdx
@@ -0,0 +1,636 @@
+---
+sidebar_position: 6
+sidebar_label: 'Order Refunds'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Order refunds
+
+The order refunds API allows you to create, view, and delete individual refunds, based on an existing order.
+
+## Order refund properties
+
+| Attribute | Type | Description |
+| ------------------ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the order refund was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the order refund was created, as GMT. `READ-ONLY` |
+| `amount` | string | Total 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. |
+| `reason` | string | Reason for refund. |
+| `refunded_by` | integer | User ID of user who created the refund. |
+| `refunded_payment` | boolean | If the payment was refunded via the API. See `api_refund`. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund---meta-data-properties) |
+| `line_items` | array | Line items data. See [Order refund - Line items properties](#order-refund---line-items-properties) |
+| `tax_lines` | array | Tax lines data. See [Order refund - Tax lines properties](#order-refund---tax-lines-properties) `READ-ONLY` |
+| `shipping_lines` | array | Shipping lines data. See [Order refund - Shipping lines properties](#order-refund---shipping-lines-properties) |
+| `fee_lines` | array | Fee lines data. See [Order refund - Fee lines properties](#order-refund---fee-lines-properties) |
+| `api_refund` | boolean | When true, the payment gateway API is used to generate the refund. Default is `true`. `WRITE-ONLY` |
+| `api_restock` | boolean | When true, the selected line items are restocked Default is `true`. `WRITE-ONLY` |
+
+### Order refund - Meta data properties
+
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+### Order refund - Line items properties
+
+| Attribute | Type | Description |
+| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Product name. |
+| `product_id` | integer | Product ID. |
+| `variation_id` | integer | Variation ID, if applicable. |
+| `quantity` | integer | Quantity ordered. |
+| `tax_class` | string | Tax class of product. |
+| `subtotal` | string | Line subtotal (before discounts). |
+| `subtotal_tax` | string | Line subtotal tax (before discounts). `READ-ONLY` |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order refund line item - Taxes properties](#order-refund-line-item---taxes-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund---meta-data-properties) |
+| `sku` | string | Product SKU. `READ-ONLY` |
+| `price` | string | Product price. `READ-ONLY` |
+
+#### Order refund line item - Taxes properties
+
+| Attribute | Type | Description |
+| ---------- | ------- | ------------------------------------------------------- |
+| `id` | integer | Tax rate ID. `READ-ONLY` |
+| `total` | string | Tax total. `READ-ONLY` |
+| `subtotal` | string | Tax subtotal. `READ-ONLY` |
+
+### Order refund - Tax lines properties
+
+| Attribute | Type | Description |
+| -------------------- | ------- | ---------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `rate_code` | string | Tax rate code. `READ-ONLY` |
+| `rate_id` | integer | Tax rate ID. `READ-ONLY` |
+| `label` | string | Tax rate label. `READ-ONLY` |
+| `compound` | boolean | Whether or not this is a compound tax rate. `READ-ONLY` |
+| `tax_total` | string | Tax total (not including shipping taxes). `READ-ONLY` |
+| `shipping_tax_total` | string | Shipping tax total. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund---meta-data-properties) |
+
+### Order refund - Shipping lines properties
+
+| Attribute | Type | Description |
+| -------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `method_title` | string | Shipping method name. |
+| `method_id` | string | Shipping method ID. |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order refund - Tax lines properties](#order-refund---tax-lines-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund---meta-data-properties) |
+
+### Order refund - Fee lines properties
+
+| Attribute | Type | Description |
+| ------------ | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Fee name. |
+| `tax_class` | string | Tax class of fee. |
+| `tax_status` | string | Tax status of fee. Options: `taxable` and `none`. |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order refund - Tax lines properties](#order-refund---tax-lines-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order refund - Meta data properties](#order-refund---meta-data-properties) |
+
+## Create a refund
+
+This API helps you to create a new refund for an order.
+
+```http
+POST /wp-json/wc/v3/orders/<id>/refunds
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ }
+ ]
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Line item parameters
+
+| Parameter | Type | Description |
+| -------------- | ------- | -------------------------------------------------------------------------- |
+| `id` | integer | The ID of the line item in the order. |
+| `refund_total` | number | The amount to refund for this line item, excluding taxes. |
+| `refund_tax` | array | Refunds for tax rates. See [Refund tax parameters](#refund-tax-parameters) |
+
+#### Refund tax parameters
+
+| Parameter | Type | Description |
+| -------------- | ------- | ----------------------------------------------- |
+| `id` | integer | The ID of the tax rate. |
+| `refund_total` | number | The amount of tax to refund for this line item. |
+
+## Retrieve a refund
+
+This API lets you retrieve and view a specific refund from an order.
+
+```http
+GET /wp-json/wc/v3/orders/<id>/refunds/<refund_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/orders/723/refunds/726 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'orders/723/refunds/726' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/723/refunds/726')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/refunds/726").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/723/refunds/726").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------- |
+| `dp` | string | Number of decimal points to use in each resource. |
+
+## List all refunds
+
+This API helps you to view all the refunds from an order.
+
+Note: To view a list of refunds from your store, regardless of order, check out the [refunds endpoint](../refunds).
+
+```http
+GET /wp-json/wc/v3/orders/<id>/refunds
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/orders/723/refunds \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'orders/723/refunds' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/723/refunds')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/723/refunds").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/723/refunds").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `dp` | integer | Number of decimal points to use in each resource. Default is `2`. |
+
+## Delete a refund
+
+This API helps you delete an order refund.
+
+```http
+DELETE /wp-json/wc/v3/orders/<id>/refunds/<refund_id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/orders/723/refunds/726?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'orders/723/refunds/726', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/723/refunds/726', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/723/refunds/726", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/723/refunds/726", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v3/orders.mdx b/docs/apis/rest-api/v3/orders.mdx
new file mode 100644
index 00000000000..066b71fd0e8
--- /dev/null
+++ b/docs/apis/rest-api/v3/orders.mdx
@@ -0,0 +1,3013 @@
+---
+sidebar_position: 3
+sidebar_label: 'Orders'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Orders
+
+The orders API allows you to create, view, update, and delete individual, or a batch, of orders.
+
+## Order properties
+
+| Attribute | Type | Description |
+| ---------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `parent_id` | integer | Parent order ID. |
+| `number` | string | Order number. `READ-ONLY` |
+| `order_key` | string | Order key. `READ-ONLY` |
+| `created_via` | string | Shows where the order was created. It can only be set during order creation and cannot be modified afterward. |
+| `version` | string | Version of WooCommerce which last updated the order. `READ-ONLY` |
+| `status` | string | Order status. Options: `pending`, `processing`, `on-hold`, `completed`, `cancelled`, `refunded`, `failed` and `trash`. Default is `pending`. |
+| `currency` | string | Currency 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_created` | date-time | The date the order was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the order was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the order was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the order was last modified, as GMT. `READ-ONLY` |
+| `discount_total` | string | Total discount amount for the order. `READ-ONLY` |
+| `discount_tax` | string | Total discount tax amount for the order. `READ-ONLY` |
+| `shipping_total` | string | Total shipping amount for the order. `READ-ONLY` |
+| `shipping_tax` | string | Total shipping tax amount for the order. `READ-ONLY` |
+| `cart_tax` | string | Sum of line item taxes only. `READ-ONLY` |
+| `total` | string | Grand total. `READ-ONLY` |
+| `total_tax` | string | Sum of all taxes. `READ-ONLY` |
+| `prices_include_tax` | boolean | True the prices included tax during checkout. `READ-ONLY` |
+| `customer_id` | integer | User ID who owns the order. 0 for guests. Default is `0`. |
+| `customer_ip_address` | string | Customer's IP address. `READ-ONLY` |
+| `customer_user_agent` | string | User agent of the customer. `READ-ONLY` |
+| `customer_note` | string | Note left by customer during checkout. |
+| `billing` | object | Billing address. See [Order - Billing properties](#order---billing-properties) |
+| `shipping` | object | Shipping address. See [Order - Shipping properties](#order---shipping-properties) |
+| `payment_method` | string | Payment method ID. |
+| `payment_method_title` | string | Payment method title. |
+| `transaction_id` | string | Unique transaction ID. |
+| `date_paid` | date-time | The date the order was paid, in the site's timezone. `READ-ONLY` |
+| `date_paid_gmt` | date-time | The date the order was paid, as GMT. `READ-ONLY` |
+| `date_completed` | date-time | The date the order was completed, in the site's timezone. `READ-ONLY` |
+| `date_completed_gmt` | date-time | The date the order was completed, as GMT. `READ-ONLY` |
+| `cart_hash` | string | MD5 hash of cart items to ensure orders are not modified. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+| `line_items` | array | Line items data. See [Order - Line items properties](#order---line-items-properties) |
+| `tax_lines` | array | Tax lines data. See [Order - Tax lines properties](#order---tax-lines-properties) `READ-ONLY` |
+| `shipping_lines` | array | Shipping lines data. See [Order - Shipping lines properties](#order---shipping-lines-properties) |
+| `fee_lines` | array | Fee lines data. See [Order - Fee lines properties](#order---fee-lines-properties) |
+| `coupon_lines` | array | Coupons line data. See [Order - Coupon lines properties](#order---coupon-lines-properties) |
+| `refunds` | array | List of refunds. See [Order - Refunds properties](#order---refunds-properties) `READ-ONLY` |
+| `set_paid` | boolean | Define if the order is paid. It will set the status to processing and reduce stock items. Default is `false`. `WRITE-ONLY` |
+
+### Order - Billing properties
+
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1 |
+| `address_2` | string | Address line 2 |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | Country code in ISO 3166-1 alpha-2 format. |
+| `email` | string | Email address. |
+| `phone` | string | Phone number. |
+
+### Order - Shipping properties
+
+| Attribute | Type | Description |
+| ------------ | ------ | ---------------------------------------------------- |
+| `first_name` | string | First name. |
+| `last_name` | string | Last name. |
+| `company` | string | Company name. |
+| `address_1` | string | Address line 1 |
+| `address_2` | string | Address line 2 |
+| `city` | string | City name. |
+| `state` | string | ISO code or name of the state, province or district. |
+| `postcode` | string | Postal code. |
+| `country` | string | Country code in ISO 3166-1 alpha-2 format. |
+
+### Order - Meta data properties
+
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+### Order - Line items properties
+
+| Attribute | Type | Description |
+| -------------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Product name. |
+| `product_id` | integer | Product ID. |
+| `variation_id` | integer | Variation ID, if applicable. |
+| `quantity` | integer | Quantity ordered. |
+| `tax_class` | string | Slug of the tax class of product. |
+| `subtotal` | string | Line subtotal (before discounts). |
+| `subtotal_tax` | string | Line subtotal tax (before discounts). `READ-ONLY` |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order - Tax lines properties](#order---tax-lines-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+| `sku` | string | Product SKU. `READ-ONLY` |
+| `price` | string | Product price. `READ-ONLY` |
+
+### Order - Tax lines properties
+
+| Attribute | Type | Description |
+| -------------------- | ------- | ------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `rate_code` | string | Tax rate code. `READ-ONLY` |
+| `rate_id` | integer | Tax rate ID. `READ-ONLY` |
+| `label` | string | Tax rate label. `READ-ONLY` |
+| `compound` | boolean | Whether or not this is a compound tax rate. `READ-ONLY` |
+| `tax_total` | string | Tax total (not including shipping taxes). `READ-ONLY` |
+| `shipping_tax_total` | string | Shipping tax total. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+### Order - Shipping lines properties
+
+| Attribute | Type | Description |
+| -------------- | ------- | --------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `method_title` | string | Shipping method name. |
+| `method_id` | string | Shipping method ID. |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order - Tax lines properties](#order---tax-lines-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+### Order - Fee lines properties
+
+| Attribute | Type | Description |
+| ------------ | ------- | --------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `name` | string | Fee name. |
+| `tax_class` | string | Tax class of fee. |
+| `tax_status` | string | Tax status of fee. Options: `taxable` and `none`. |
+| `total` | string | Line total (after discounts). |
+| `total_tax` | string | Line total tax (after discounts). `READ-ONLY` |
+| `taxes` | array | Line taxes. See [Order - Tax lines properties](#order---tax-lines-properties) `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+### Order - Coupon lines properties
+
+| Attribute | Type | Description |
+| -------------- | ------- | -------------------------------------------------------------------------- |
+| `id` | integer | Item ID. `READ-ONLY` |
+| `code` | string | Coupon code. |
+| `discount` | string | Discount total. `READ-ONLY` |
+| `discount_tax` | string | Discount total tax. `READ-ONLY` |
+| `meta_data` | array | Meta data. See [Order - Meta data properties](#order---meta-data-properties) |
+
+### Order - Refunds properties
+
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------------- |
+| `id` | integer | Refund ID. `READ-ONLY` |
+| `reason` | string | Refund reason. `READ-ONLY` |
+| `total` | string | Refund total. `READ-ONLY` |
+
+## Create an order
+
+This API helps you to create a new order.
+
+```http
+POST /wp-json/wc/v3/orders
+```
+
+> Example of create a paid order:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an order
+
+This API lets you retrieve and view a specific order.
+
+```http
+GET /wp-json/wc/v3/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/orders/727 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'orders/727' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders/727')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders/727").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders/727").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------- |
+| `dp` | string | Number of decimal points to use in each resource. |
+
+## List all orders
+
+This API helps you to view all the orders.
+
+```http
+GET /wp-json/wc/v3/orders
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/orders \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'orders' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('orders')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("orders").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("orders").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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 – 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"
+ }
+ ],
+ "email_templates": [
+ {
+ "embeddable": true,
+ "href": "http://example.com/wp-json/wc/v3/orders/723/actions/email_templates"
+ }
+ ]
+ }
+ },
+ {
+ "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 × 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"
+ }
+ ],
+ "email_templates": [
+ {
+ "embeddable": true,
+ "href": "http://example.com/wp-json/wc/v3/orders/723/actions/email_templates"
+ }
+ ],
+ "customer": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/customers/26"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `modified_after` | string | Limit response to resources modified after a given ISO8601 compliant date. |
+| `modified_before` | string | Limit response to resources modified after a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Whether to interpret dates as GMT when limiting response by published or modified date. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `status` | array | Limit result set to orders assigned a specific status. Options: `any`, `pending`, `processing`, `on-hold`, `completed`, `cancelled`, `refunded`, `failed` and `trash`. Default is `any`. |
+| `customer` | integer | Limit result set to orders assigned a specific customer. |
+| `product` | integer | Limit result set to orders assigned a specific product. |
+| `dp` | integer | Number of decimal points to use in each resource. Default is `2`. |
+| `created_via` | string | Limit result set to orders created via specific sources (e.g. checkout, store-api). Multiple options can be provided as a comma-separated list. |
+
+## Update an Order
+
+This API lets you make changes to an order.
+
+### HTTP Request
+
+```http
+PUT /wp-json/wc/v3/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ status: 'completed',
+};
+
+WooCommerce.put( 'orders/727', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'status' => 'completed'
+];
+
+print_r($woocommerce->put('orders/727', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "status": "completed"
+}
+
+print(wcapi.put("orders/727", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ status: "completed"
+}
+
+woocommerce.put("orders/727", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete an order
+
+This API helps you delete an order.
+
+```http
+DELETE /wp-json/wc/v3/orders/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/orders/727?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'orders/727', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('orders/727', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("orders/727", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("orders/727", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ----------------------------------------------------------------------- |
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/orders/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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 – 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 – 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 – 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 – 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 × 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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/payment-gateways.mdx b/docs/apis/rest-api/v3/payment-gateways.mdx
new file mode 100644
index 00000000000..6ea8678e5d5
--- /dev/null
+++ b/docs/apis/rest-api/v3/payment-gateways.mdx
@@ -0,0 +1,662 @@
+---
+sidebar_position: 23
+sidebar_label: 'Payment Gateways'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+
+| Attribute | Type | Description |
+| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------- |
+| `id` | string | Payment gateway ID. `READ-ONLY` |
+| `title` | string | Payment gateway title on checkout. |
+| `description` | string | Payment gateway description on checkout. |
+| `order` | integer | Payment gateway sort order. |
+| `enabled` | boolean | Payment gateway enabled status. |
+| `method_title` | string | Payment gateway method title. `READ-ONLY` |
+| `method_description` | string | Payment gateway method description. `READ-ONLY` |
+| `method_supports` | array | Supported features for this payment gateway. `READ-ONLY` |
+| `settings` | object | Payment gateway settings. See [Payment gateway - Settings properties](#payment-gateway---settings-properties) |
+
+### Payment gateway - Settings properties
+
+| Attribute | Type | Description |
+| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier for the setting. `READ-ONLY` |
+| `label` | string | A human readable label for the setting used in interfaces. `READ-ONLY` |
+| `description` | string | A human readable description for the setting used in interfaces. `READ-ONLY` |
+| `type` | string | Type of setting. Options: `text`, `email`, `number`, `color`, `password`, `textarea`, `select`, `multiselect`, `radio`, `image_width` and `checkbox`. `READ-ONLY` |
+| `value` | string | Setting value. |
+| `default` | string | Default value for the setting. `READ-ONLY` |
+| `tip` | string | Additional help text shown to the user about the setting. `READ-ONLY` |
+| `placeholder` | string | Placeholder text to be displayed in text inputs. `READ-ONLY` |
+
+## Retrieve a payment gateway
+
+This API lets you retrieve and view a specific payment gateway.
+
+```http
+GET /wp-json/wc/v3/payment_gateways/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/payment_gateways/bacs \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'payment_gateways/bacs' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('payment_gateways/bacs')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("payment_gateways/bacs").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("payment_gateways/bacs").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all payment gateways
+
+This API helps you to view all the payment gateways.
+
+```http
+GET /wp-json/wc/v3/payment_gateways
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/payment_gateways \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'payment_gateways' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('payment_gateways')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("payment_gateways").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("payment_gateways").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a payment gateway
+
+This API lets you make changes to a payment gateway.
+
+```http
+PUT /wp-json/wc/v3/payment_gateways/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ enabled: true,
+};
+
+WooCommerce.put( 'payment_gateways/bacs', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'enabled' => true
+];
+
+print_r($woocommerce->put('payment_gateways/bacs', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "enabled": True
+}
+
+print(wcapi.put("payment_gateways/bacs", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ enabled: true
+}
+
+woocommerce.put("payment_gateways/bacs", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/product-attribute-terms.mdx b/docs/apis/rest-api/v3/product-attribute-terms.mdx
new file mode 100644
index 00000000000..906dec34559
--- /dev/null
+++ b/docs/apis/rest-api/v3/product-attribute-terms.mdx
@@ -0,0 +1,884 @@
+---
+sidebar_position: 10
+sidebar_label: 'Product Attribute Terms'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+
+| Attribute | Type | Description |
+| ------------- | ------- | ---------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Term name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `menu_order` | integer | Menu order, used to custom sort the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create an attribute term
+
+This API helps you to create a new product attribute term.
+
+```http
+POST /wp-json/wc/v3/products/attributes/<attribute_id>/terms
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: 'XXS',
+};
+
+WooCommerce.post( 'products/attributes/2/terms', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'XXS'
+];
+
+print_r($woocommerce->post('products/attributes/2/terms', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "XXS"
+}
+
+print(wcapi.post("products/attributes/2/terms", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "XXS"
+}
+
+woocommerce.post("products/attributes/2/terms", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve an attribute term
+
+This API lets you retrieve a product attribute term by ID.
+
+```http
+GET /wp-json/wc/v3/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/attributes/2/terms/23 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/attributes/2/terms/23' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/2/terms/23')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/2/terms/23").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/2/terms/23").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all attribute terms
+
+This API lets you retrieve all terms from a product attribute.
+
+```http
+GET /wp-json/wc/v3/products/attributes/<attribute_id>/terms
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/attributes/2/terms \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/attributes/2/terms' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/2/terms')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/2/terms").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/2/terms").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. Default is `name`. |
+| `hide_empty` | boolean | Whether to hide resources not assigned to any products. Default is `false`. |
+| `parent` | integer | Limit result set to resources assigned to a specific parent. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update an attribute term
+
+This API lets you make changes to a product attribute term.
+
+```http
+PUT /wp-json/wc/v3/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'XXS'
+];
+
+print_r($woocommerce->put('products/attributes/2/terms/23', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "XXS"
+}
+
+print(wcapi.put("products/attributes/2/terms/23", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "XXS"
+}
+
+woocommerce.put("products/attributes/2/terms/23", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete an attribute term
+
+This API helps you delete a product attribute term.
+
+```http
+DELETE /wp-json/wc/v3/products/attributes/<attribute_id>/terms/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/products/attributes/2/terms/23?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'products/attributes/2/terms/23', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/attributes/2/terms/23', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/attributes/2/terms/23", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/attributes/2/terms/23", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/products/attributes/<attribute_id>/terms/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X POST https://example.com/wp-json/wc/v3/products/attributes/<attribute_id>/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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/product-attributes.mdx b/docs/apis/rest-api/v3/product-attributes.mdx
new file mode 100644
index 00000000000..b19f93728ee
--- /dev/null
+++ b/docs/apis/rest-api/v3/product-attributes.mdx
@@ -0,0 +1,773 @@
+---
+sidebar_position: 9
+sidebar_label: 'Product Attributes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product attributes
+
+The product attributes API allows you to create, view, update, and delete individual, or a batch, of product attributes.
+
+## Product attribute properties
+
+| Attribute | Type | Description |
+| -------------- | ------- | ------------------------------------------------------------------------------------------------ |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Attribute name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `type` | string | Type of attribute. By default only `select` is supported. |
+| `order_by` | string | Default sort order. Options: `menu_order`, `name`, `name_num` and `id`. Default is `menu_order`. |
+| `has_archives` | boolean | Enable/Disable attribute archives. Default is `false`. |
+
+## Create a product attribute
+
+This API helps you to create a new product attribute.
+
+```http
+POST /wp-json/wc/v3/products/attributes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Color',
+ 'slug' => 'pa_color',
+ 'type' => 'select',
+ 'order_by' => 'menu_order',
+ 'has_archives' => true
+];
+
+print_r($woocommerce->post('products/attributes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": True
+}
+
+print(wcapi.post("products/attributes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Color",
+ slug: "pa_color",
+ type: "select",
+ order_by: "menu_order",
+ has_archives: true
+}
+
+woocommerce.post("products/attributes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product attribute
+
+This API lets you retrieve and view a specific product attribute by ID.
+
+```http
+GET /wp-json/wc/v3/products/attributes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/attributes/1 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/attributes/1' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes/1')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes/1").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes/1").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product attributes
+
+This API helps you to view all the product attributes.
+
+```http
+GET /wp-json/wc/v3/products/attributes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/attributes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/attributes' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/attributes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/attributes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/attributes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope 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
+PUT /wp-json/wc/v3/products/attributes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ order_by: 'name',
+};
+
+WooCommerce.put( 'products/attributes/1', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'order_by' => 'name'
+];
+
+print_r($woocommerce->put('products/attributes/1', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "order_by": "name"
+}
+
+print(wcapi.put("products/attributes/1", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ order_by: "name"
+}
+
+woocommerce.put("products/attributes/1", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product attribute
+
+This API helps you delete a product attribute.
+
+```http
+DELETE /wp-json/wc/v3/products/attributes/<id>
+```
+
+:::warning
+This also will delete all terms from the selected attribute.
+:::
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/products/attributes/1?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'products/attributes/1', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/attributes/1', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/attributes/1", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/attributes/1", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/products/attributes/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Brand'
+ ],
+ [
+ 'name' => 'Publisher'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 2,
+ 'order_by' => 'name'
+ ]
+ ],
+ 'delete' => [
+ 1
+ ]
+];
+
+print_r($woocommerce->post('products/attributes/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Brand"
+ },
+ {
+ "name": "Publisher"
+ }
+ ],
+ "update": [
+ {
+ "id": 2,
+ "order_by": "name"
+ }
+ ],
+ "delete": [
+ 1
+ ]
+}
+
+print(wcapi.post("products/attributes/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Round toe"
+ },
+ {
+ name: "Flat"
+ }
+ ],
+ update: [
+ {
+ id: 2,
+ order_by: "name"
+ }
+ ],
+ delete: [
+ 1
+ ]
+}
+
+woocommerce.post("products/attributes/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/product-categories.mdx b/docs/apis/rest-api/v3/product-categories.mdx
new file mode 100644
index 00000000000..97516807076
--- /dev/null
+++ b/docs/apis/rest-api/v3/product-categories.mdx
@@ -0,0 +1,1040 @@
+---
+sidebar_position: 11
+sidebar_label: 'Product Categories'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product categories
+
+The product categories API allows you to create, view, update, and delete individual, or a batch, of categories.
+
+## Product category properties
+
+| Attribute | Type | Description |
+| ------------- | ------- | ---------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Category name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `parent` | integer | The ID for the parent of the resource. |
+| `description` | string | HTML description of the resource. |
+| `display` | string | Category archive display type. Options: `default`, `products`, `subcategories` and `both`. Default is `default`. |
+| `image` | object | Image data. See [Product category - Image properties](#product-category---image-properties) |
+| `menu_order` | integer | Menu order, used to custom sort the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+### Product category - Image properties
+
+| Attribute | Type | Description |
+| ------------------- | --------- | ------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Image ID. |
+| `date_created` | date-time | The date the image was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the image was created, as GMT `READ-ONLY` |
+| `date_modified` | date-time | The date the image was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the image was last modified, as GMT. `READ-ONLY` |
+| `src` | string | Image URL. |
+| `name` | string | Image name. |
+| `alt` | string | Image alternative text. |
+
+## Create a product category
+
+This API helps you to create a new product category.
+
+```http
+POST /wp-json/wc/v3/products/categories
+```
+
+> Example of how to create a product category:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product category
+
+This API lets you retrieve a product category by ID.
+
+```http
+GET /wp-json/wc/v3/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/categories/9 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/categories/9' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/categories/9')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/categories/9").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/categories/9").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product categories
+
+This API lets you retrieve all product categories.
+
+```http
+GET /wp-json/wc/v3/products/categories
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/categories \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/categories' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/categories')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/categories").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/categories").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. Default is `name`. |
+| `hide_empty` | boolean | Whether to hide resources not assigned to any products. Default is `false`. |
+| `parent` | integer | Limit result set to resources assigned to a specific parent. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a product category
+
+This API lets you make changes to a product category.
+
+```http
+PUT /wp-json/wc/v3/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description' => 'All kinds of clothes.'
+];
+
+print_r($woocommerce->put('products/categories/9', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "All kinds of clothes."
+}
+
+print(wcapi.put("products/categories/9", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "All kinds of clothes."
+}
+
+woocommerce.put("products/categories/9", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product category
+
+This API helps you delete a product category.
+
+```http
+DELETE /wp-json/wc/v3/products/categories/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/products/categories/9?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'products/categories/9', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/categories/9', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/categories/9", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/categories/9", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/products/categories/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Albums'
+ ],
+ [
+ 'name' => 'Clothing'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 10,
+ 'description' => 'Nice hoodies'
+ ]
+ ],
+ 'delete' => [
+ 11,
+ 12
+ ]
+];
+
+print_r($woocommerce->post('products/categories/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Albums"
+ },
+ {
+ "name": "Clothing"
+ }
+ ],
+ "update": [
+ {
+ "id": 10,
+ "description": "Nice hoodies"
+ }
+ ],
+ "delete": [
+ 11,
+ 12
+ ]
+}
+
+print(wcapi.post("products/categories/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Albums"
+ },
+ {
+ name: "Clothing"
+ }
+ ],
+ update: [
+ {
+ id: 10,
+ description: "Nice hoodies"
+ }
+ ],
+ delete: [
+ 11,
+ 12
+ ]
+}
+
+woocommerce.post("products/categories/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/product-custom-fields.mdx b/docs/apis/rest-api/v3/product-custom-fields.mdx
new file mode 100644
index 00000000000..478b8ec6fdd
--- /dev/null
+++ b/docs/apis/rest-api/v3/product-custom-fields.mdx
@@ -0,0 +1,86 @@
+---
+sidebar_position: 12
+sidebar_label: 'Product Custom Fields'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product custom fields
+
+The product custom fields API allows you to view the custom field names that have been recorded.
+
+## Custom fields available parameters
+
+| Parameter | Type | Description |
+| ---------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+
+## Retrieve product custom field names
+
+This API lets you retrieve filtered custom field names.
+
+```http
+GET /wp-json/wc/v3/products/custom-fields/names
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/custom-fields/names \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/custom-fields/names' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/custom-fields/names')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/custom-fields/names").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/custom-fields/names").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ "Custom field 1",
+ "Custom field 2",
+ "Custom field 3",
+ "Custom field 4"
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/product-reviews.mdx b/docs/apis/rest-api/v3/product-reviews.mdx
new file mode 100644
index 00000000000..c9e1cc6fa35
--- /dev/null
+++ b/docs/apis/rest-api/v3/product-reviews.mdx
@@ -0,0 +1,960 @@
+---
+sidebar_position: 15
+sidebar_label: 'Product Reviews'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product reviews
+
+The product reviews API allows you to create, view, update, and delete individual, or a batch, of product reviews.
+
+## Product review properties
+
+| Attribute | Type | Description |
+| ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | string | The date the review was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | string | The date the review was created, as GMT. `READ-ONLY` |
+| `product_id` | integer | Unique identifier for the product that the review belongs to. |
+| `status` | string | Status of the review. Options: `approved`, `hold`, `spam`, `unspam`, `trash` and `untrash`. Defaults to `approved`. |
+| `reviewer` | string | Reviewer name. |
+| `reviewer_email` | string | Reviewer email. |
+| `review` | string | The content of the review. |
+| `rating` | integer | Review rating (0 to 5). |
+| `verified` | boolean | Shows if the reviewer bought the product or not. |
+
+## Create a product review
+
+This API helps you to create a new product review.
+
+```http
+POST /wp-json/wc/v3/products/reviews
+```
+
+> Example of how to create a product review:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product review
+
+This API lets you retrieve a product review by ID.
+
+```http
+GET /wp-json/wc/v3/products/reviews/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/reviews/22 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/reviews/22' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/reviews/22')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/reviews/22").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/reviews/22").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product reviews
+
+This API lets you retrieve all product review.
+
+```http
+GET /wp-json/wc/v3/products/reviews
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/reviews \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/reviews' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/reviews')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/reviews").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/reviews").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to reviews published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to reviews published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `date`, `date_gmt`, `id`, `slug`, `include` and `product`. Default is `date_gmt`. |
+| `reviewer` | array | Limit result set to reviews assigned to specific user IDs. |
+| `reviewer_exclude` | array | Ensure result set excludes reviews assigned to specific user IDs. |
+| `reviewer_email` | array | Limit result set to that from a specific author email. |
+| `product` | array | Limit result set to reviews assigned to specific product IDs. |
+| `status` | string | Limit 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
+PUT /wp-json/wc/v3/products/reviews/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ rating: 5,
+};
+
+WooCommerce.put( 'products/reviews/20', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'rating' => 5
+];
+
+print_r($woocommerce->put('products/reviews/20', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "rating": 5
+}
+
+print(wcapi.put("products/reviews/20", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ rating: 5
+}
+
+woocommerce.put("products/reviews/20", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product review
+
+This API helps you delete a product review.
+
+```http
+DELETE /wp-json/wc/v3/products/reviews/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/products/reviews/34?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'products/reviews/20', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/reviews/20', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/reviews/20", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/reviews/20", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/products/reviews/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/product-shipping-classes.mdx b/docs/apis/rest-api/v3/product-shipping-classes.mdx
new file mode 100644
index 00000000000..4a5edc35f98
--- /dev/null
+++ b/docs/apis/rest-api/v3/product-shipping-classes.mdx
@@ -0,0 +1,751 @@
+---
+sidebar_position: 13
+sidebar_label: 'Product Shipping Classes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+
+| Attribute | Type | Description |
+| ------------- | ------- | ---------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Shipping class name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create a shipping class
+
+This API helps you to create a new product shipping class.
+
+```http
+POST /wp-json/wc/v3/products/shipping_classes
+```
+
+> Example of how to create a product shipping class:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: 'Priority',
+};
+
+WooCommerce.post( 'products/shipping_classes', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Priority'
+];
+
+print_r($woocommerce->post('products/shipping_classes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Priority"
+}
+
+print(wcapi.post("products/shipping_classes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Priority"
+}
+
+woocommerce.post("products/shipping_classes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a shipping class
+
+This API lets you retrieve a product shipping class by ID.
+
+```http
+GET /wp-json/wc/v3/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/shipping_classes/32 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/shipping_classes/32' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/shipping_classes/32')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/shipping_classes/32").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/shipping_classes/32").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping classes
+
+This API lets you retrieve all product shipping classes.
+
+```http
+GET /wp-json/wc/v3/products/shipping_classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/shipping_classes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/shipping_classes' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/shipping_classes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/shipping_classes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/shipping_classes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. Default is `name`. |
+| `hide_empty` | boolean | Whether to hide resources not assigned to any products. Default is `false`. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a shipping class
+
+This API lets you make changes to a product shipping class.
+
+```http
+PUT /wp-json/wc/v3/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description' => 'Priority mail.'
+];
+
+print_r($woocommerce->put('products/shipping_classes/32', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "Priority mail."
+}
+
+print(wcapi.put("products/shipping_classes/32", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "Priority mail."
+}
+
+woocommerce.put("products/shipping_classes/32", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a shipping class
+
+This API helps you delete a product shipping class.
+
+```http
+DELETE /wp-json/wc/v3/products/shipping_classes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/products/shipping_classes/32?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'products/shipping_classes/32', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/shipping_classes/32', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/shipping_classes/32", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/shipping_classes/32", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/products/shipping_classes/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/product-tags.mdx b/docs/apis/rest-api/v3/product-tags.mdx
new file mode 100644
index 00000000000..a1f1df99815
--- /dev/null
+++ b/docs/apis/rest-api/v3/product-tags.mdx
@@ -0,0 +1,751 @@
+---
+sidebar_position: 14
+sidebar_label: 'Product Tags'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product tags
+
+The product tags API allows you to create, view, update, and delete individual, or a batch, of product tags.
+
+## Product tag properties
+
+| Attribute | Type | Description |
+| ------------- | ------- | ---------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Tag name. `MANDATORY` |
+| `slug` | string | An alphanumeric identifier for the resource unique to its type. |
+| `description` | string | HTML description of the resource. |
+| `count` | integer | Number of published products for the resource. `READ-ONLY` |
+
+## Create a product tag
+
+This API helps you to create a new product tag.
+
+```http
+POST /wp-json/wc/v3/products/tags
+```
+
+> Example of how to create a product tag:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: 'Leather Shoes',
+};
+
+WooCommerce.post( 'products/tags', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Leather Shoes'
+];
+
+print_r($woocommerce->post('products/tags', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Leather Shoes"
+}
+
+print(wcapi.post("products/tags", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Leather Shoes"
+}
+
+woocommerce.post("products/tags", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product tag
+
+This API lets you retrieve a product tag by ID.
+
+```http
+GET /wp-json/wc/v3/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/tags/34 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/tags/34' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/tags/34')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/tags/34").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/tags/34").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product tags
+
+This API lets you retrieve all product tag.
+
+```http
+GET /wp-json/wc/v3/products/tags
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/tags \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/tags' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/tags')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/tags").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/tags").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `exclude` | array | Ensure result set excludes specific ids. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `asc`. |
+| `orderby` | string | Sort collection by resource attribute. Options: `id`, `include`, `name`, `slug`, `term_group`, `description` and `count`. Default is `name`. |
+| `hide_empty` | boolean | Whether to hide resources not assigned to any products. Default is `false`. |
+| `product` | integer | Limit result set to resources assigned to a specific product. |
+| `slug` | string | Limit result set to resources with a specific slug. |
+
+## Update a product tag
+
+This API lets you make changes to a product tag.
+
+```http
+PUT /wp-json/wc/v3/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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."
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ description: 'Genuine leather.',
+};
+
+WooCommerce.put( 'products/tags/34', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'description': 'Genuine leather.'
+];
+
+print_r($woocommerce->put('products/tags/34', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "description": "Genuine leather."
+}
+
+print(wcapi.put("products/tags/34", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ description: "Genuine leather."
+}
+
+woocommerce.put("products/tags/34", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product tag
+
+This API helps you delete a product tag.
+
+```http
+DELETE /wp-json/wc/v3/products/tags/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/products/tags/34?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'products/tags/34', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/tags/34', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/tags/34", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/tags/34", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/products/tags/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'create' => [
+ [
+ 'name' => 'Round toe'
+ ],
+ [
+ 'name' => 'Flat'
+ ]
+ ],
+ 'update' => [
+ [
+ 'id' => 34,
+ 'description' => 'Genuine leather.'
+ ]
+ ],
+ 'delete' => [
+ 35
+ ]
+];
+
+print_r($woocommerce->post('products/tags/batch', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "create": [
+ {
+ "name": "Round toe"
+ },
+ {
+ "name": "Flat"
+ }
+ ],
+ "update": [
+ {
+ "id": 34,
+ "description": "Genuine leather."
+ }
+ ],
+ "delete": [
+ 35
+ ]
+}
+
+print(wcapi.post("products/tags/batch", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ create: [
+ {
+ name: "Round toe"
+ },
+ {
+ name: "Flat"
+ }
+ ],
+ update: [
+ {
+ id: 34,
+ description: "Genuine leather."
+ }
+ ],
+ delete: [
+ 35
+ ]
+}
+
+woocommerce.post("products/tags/batch", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/product-variations.mdx b/docs/apis/rest-api/v3/product-variations.mdx
new file mode 100644
index 00000000000..62a998b1a93
--- /dev/null
+++ b/docs/apis/rest-api/v3/product-variations.mdx
@@ -0,0 +1,1528 @@
+---
+sidebar_position: 8
+sidebar_label: 'Product Variations'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Product variations
+
+The product variations API allows you to create, view, update, and delete individual, or a batch, of product variations.
+
+## Product variation properties
+
+| Attribute | Type | Description |
+| ----------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `date_created` | date-time | The date the variation was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the variation was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the variation was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the variation was last modified, as GMT. `READ-ONLY` |
+| `description` | string | Variation description. |
+| `permalink` | string | Variation URL. `READ-ONLY` |
+| `sku` | string | Unique identifier. |
+| `global_unique_id` | string | GTIN, UPC, EAN or ISBN. A global unique identifier for the variation. |
+| `price` | string | Current variation price. `READ-ONLY` |
+| `regular_price` | string | Variation regular price. |
+| `sale_price` | string | Variation sale price. |
+| `date_on_sale_from` | date-time | Start date of sale price, in the site's timezone. |
+| `date_on_sale_from_gmt` | date-time | Start date of sale price, as GMT. |
+| `date_on_sale_to` | date-time | End date of sale price, in the site's timezone. |
+| `date_on_sale_to_gmt` | date-time | End date of sale price, as GMT. |
+| `on_sale` | boolean | Shows if the variation is on sale. `READ-ONLY` |
+| `status` | string | Variation status. Options: `draft`, `pending`, `private` and `publish`. Default is `publish`. |
+| `purchasable` | boolean | Shows if the variation can be bought. `READ-ONLY` |
+| `virtual` | boolean | If the variation is virtual. Default is `false`. |
+| `downloadable` | boolean | If the variation is downloadable. Default is `false`. |
+| `downloads` | array | List of downloadable files. See [Product variation - Downloads properties](#product-variation---downloads-properties) |
+| `download_limit` | integer | Number of times downloadable files can be downloaded after purchase. Default is `-1`. |
+| `download_expiry` | integer | Number of days until access to downloadable files expires. Default is `-1`. |
+| `tax_status` | string | Tax status. Options: `taxable`, `shipping` and `none`. Default is `taxable`. |
+| `tax_class` | string | Tax class. |
+| `manage_stock` | boolean, string | Stock management at variation level. Possible values are either a boolean or `parent`. Default is `false`. |
+| `stock_quantity` | integer | Stock quantity. |
+| `stock_status` | string | Controls the stock status of the product. Options: `instock`, `outofstock`, `onbackorder`. Default is `instock`. |
+| `backorders` | string | If managing stock, this controls if backorders are allowed. Options: `no`, `notify` and `yes`. Default is `no`. |
+| `backorders_allowed` | boolean | Shows if backorders are allowed. `READ-ONLY` |
+| `backordered` | boolean | Shows if the variation is on backordered. `READ-ONLY` |
+| `weight` | string | Variation weight. |
+| `dimensions` | object | Variation dimensions. See [Product variation - Dimensions properties](#product-variation---dimensions-properties) |
+| `shipping_class` | string | Shipping class slug. |
+| `shipping_class_id` | string | Shipping class ID. `READ-ONLY` |
+| `image` | object | Variation image data. See [Product variation - Image properties](#product-variation---image-properties) |
+| `attributes` | array | List of attributes. See [Product variation - Attributes properties](#product-variation---attributes-properties) |
+| `menu_order` | integer | Menu order, used to custom sort products. |
+| `meta_data` | array | Meta data. See [Product variation - Meta data properties](#product-variation---meta-data-properties) |
+
+### Product variation - Downloads properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ----------- |
+| `id` | string | File ID. |
+| `name` | string | File name. |
+| `file` | string | File URL. |
+
+### Product variation - Dimensions properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ----------------- |
+| `length` | string | Variation length. |
+| `width` | string | Variation width. |
+| `height` | string | Variation height. |
+
+### Product variation - Image properties
+
+| Attribute | Type | Description |
+| ------------------- | --------- | ------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Image ID. |
+| `date_created` | date-time | The date the image was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the image was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the image was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the image was last modified, as GMT. `READ-ONLY` |
+| `src` | string | Image URL. |
+| `name` | string | Image name. |
+| `alt` | string | Image alternative text. |
+
+### Product variation - Attributes properties
+
+| Attribute | Type | Description |
+| --------- | ------- | ----------------------------- |
+| `id` | integer | Attribute ID. |
+| `name` | string | Attribute name. |
+| `option` | string | Selected attribute term name. |
+
+### Product variation - Meta data properties
+
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+## Create a product variation
+
+This API helps you to create a new product variation.
+
+```http
+POST /wp-json/wc/v3/products/<product_id>/variations
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'regular_price' => '9.00',
+ 'image' => [
+ 'id' => 423
+ ],
+ 'attributes' => [
+ [
+ 'id' => 9,
+ 'option' => 'Black'
+ ]
+ ]
+];
+
+print_r($woocommerce->post('products/22/variations', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "regular_price": "9.00",
+ "image": {
+ "id": 423
+ },
+ "attributes": [
+ {
+ "id": 9,
+ "option": "Black"
+ }
+ ]
+}
+
+print(wcapi.post("products/22/variations", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ regular_price: "9.00",
+ image: {
+ id: 423
+ },
+ attributes: [
+ {
+ id: 9,
+ option: "Black"
+ }
+ ]
+}
+
+woocommerce.post("products/22/variations", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product variation
+
+This API lets you retrieve and view a specific product variation by ID.
+
+```http
+GET /wp-json/wc/v3/products/<product_id>/variations/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/22/variations/732 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/22/variations/732' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/22/variations/732')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/22/variations/732").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/22/variations/732").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all product variations
+
+This API helps you to view all the product variations.
+
+```http
+GET /wp-json/wc/v3/products/<product_id>/variations
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/22/variations \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/22/variations' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/22/variations')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/22/variations").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/22/variations").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ---------------- | ------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Interpret `after` and `before` as UTC dates when `true`. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `slug` | string | Limit result set to products with a specific slug. |
+| `status` | string | Limit result set to products assigned a specific status. Options: `any`, `draft`, `pending`, `private` and `publish`. Default is `any`. |
+| `include_status` | string | Limit result set to product variations with any of the specified statuses. Multiple statuses can be provided as a comma-separated list. Takes precedence over the `status` parameter. Options: `any`, `future`, `trash`, `draft`, `pending`, `private`, and `publish`. |
+| `exclude_status` | string | Exclude product variations from result set with any of the specified statuses. Multiple statuses can be provided as a comma-separated list. Takes precedence over the `include_status` parameter. Options: `future`, `trash`, `draft`, `pending`, `private`, and `publish`. |
+| `sku` | string | Limit result set to products with a specific SKU. |
+| `tax_class` | string | Limit result set to products with a specific tax class. Default options: `standard`, `reduced-rate` and `zero-rate`. |
+| `on_sale` | boolean | Limit result set to products on sale. |
+| `min_price` | string | Limit result set to products based on a minimum price. |
+| `max_price` | string | Limit result set to products based on a maximum price. |
+| `stock_status` | string | Limit result set to products with specified stock status. Options: `instock`, `outofstock` and `onbackorder`. |
+| `virtual` | boolean | Limit result set to virtual product variations |
+| `downloadable` | boolean | Limit result set to downloadable product variations. |
+
+## Update a product variation
+
+This API lets you make changes to a product variation.
+
+```http
+PUT /wp-json/wc/v3/products/<product_id>/variations/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'regular_price' => '10.00'
+];
+
+print_r($woocommerce->put('products/22/variations/733', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "regular_price": "10.00"
+}
+
+print(wcapi.put("products/22/variations/733", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ regular_price: "10.00"
+}
+
+woocommerce.put("products/22/variations/733", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product variation
+
+This API helps you delete a product variation.
+
+```http
+DELETE /wp-json/wc/v3/products/<product_id>/variations/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/products/22/variations/733?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'products/22/variations/733', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/22/variations/733', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/22/variations/733", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/22/variations/733", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/products/<product_id>/variations/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/products.mdx b/docs/apis/rest-api/v3/products.mdx
new file mode 100644
index 00000000000..4344ac24f4b
--- /dev/null
+++ b/docs/apis/rest-api/v3/products.mdx
@@ -0,0 +1,2985 @@
+---
+sidebar_position: 7
+sidebar_label: 'Products'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Products
+
+The products API allows you to create, view, update, and delete individual, or a batch, of products.
+
+## Product properties
+
+| Attribute | Type | Description |
+| ----------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Product name. |
+| `slug` | string | Product slug. |
+| `permalink` | string | Product URL. `READ-ONLY` |
+| `date_created` | date-time | The date the product was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the product was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the product was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the product was last modified, as GMT. `READ-ONLY` |
+| `type` | string | Product type. Options: `simple`, `grouped`, `external` and `variable`. Default is `simple`. |
+| `status` | string | Product status (post status). Options: `draft`, `pending`, `private` and `publish`. Default is `publish`. |
+| `featured` | boolean | Featured product. Default is `false`. |
+| `catalog_visibility` | string | Catalog visibility. Options: `visible`, `catalog`, `search` and `hidden`. Default is `visible`. |
+| `description` | string | Product description. |
+| `short_description` | string | Product short description. |
+| `sku` | string | Unique identifier. |
+| `global_unique_id` | string | GTIN, UPC, EAN or ISBN - a unique identifier for each distinct product and service that can be purchased. |
+| `price` | string | Current product price. `READ-ONLY` |
+| `regular_price` | string | Product regular price. |
+| `sale_price` | string | Product sale price. |
+| `date_on_sale_from` | date-time | Start date of sale price, in the site's timezone. |
+| `date_on_sale_from_gmt` | date-time | Start date of sale price, as GMT. |
+| `date_on_sale_to` | date-time | End date of sale price, in the site's timezone. |
+| `date_on_sale_to_gmt` | date-time | End date of sale price, as GMT. |
+| `price_html` | string | Price formatted in HTML. `READ-ONLY` |
+| `on_sale` | boolean | Shows if the product is on sale. `READ-ONLY` |
+| `purchasable` | boolean | Shows if the product can be bought. `READ-ONLY` |
+| `total_sales` | integer | Amount of sales. `READ-ONLY` |
+| `virtual` | boolean | If the product is virtual. Default is `false`. |
+| `downloadable` | boolean | If the product is downloadable. Default is `false`. |
+| `downloads` | array | List of downloadable files. See [Product - Downloads properties](#product---downloads-properties) |
+| `download_limit` | integer | Number of times downloadable files can be downloaded after purchase. Default is `-1`. |
+| `download_expiry` | integer | Number of days until access to downloadable files expires. Default is `-1`. |
+| `external_url` | string | Product external URL. Only for external products. |
+| `button_text` | string | Product external button text. Only for external products. |
+| `tax_status` | string | Tax status. Options: `taxable`, `shipping` and `none`. Default is `taxable`. |
+| `tax_class` | string | Tax class. |
+| `manage_stock` | boolean | Stock management at product level. Default is `false`. |
+| `stock_quantity` | integer | Stock quantity. |
+| `stock_status` | string | Controls the stock status of the product. Options: `instock`, `outofstock`, `onbackorder`. Default is `instock`. |
+| `backorders` | string | If managing stock, this controls if backorders are allowed. Options: `no`, `notify` and `yes`. Default is `no`. |
+| `backorders_allowed` | boolean | Shows if backorders are allowed. `READ-ONLY` |
+| `backordered` | boolean | Shows if the product is on backordered. `READ-ONLY` |
+| `sold_individually` | boolean | Allow one item to be bought in a single order. Default is `false`. |
+| `weight` | string | Product weight. |
+| `dimensions` | object | Product dimensions. See [Product - Dimensions properties](#product---dimensions-properties) |
+| `shipping_required` | boolean | Shows if the product need to be shipped. `READ-ONLY` |
+| `shipping_taxable` | boolean | Shows whether or not the product shipping is taxable. `READ-ONLY` |
+| `shipping_class` | string | Shipping class slug. |
+| `shipping_class_id` | integer | Shipping class ID. `READ-ONLY` |
+| `reviews_allowed` | boolean | Allow reviews. Default is `true`. |
+| `average_rating` | string | Reviews average rating. `READ-ONLY` |
+| `rating_count` | integer | Amount of reviews that the product have. `READ-ONLY` |
+| `related_ids` | array | List of related products IDs. `READ-ONLY` |
+| `upsell_ids` | array | List of up-sell products IDs. |
+| `cross_sell_ids` | array | List of cross-sell products IDs. |
+| `parent_id` | integer | Product parent ID. |
+| `purchase_note` | string | Optional note to send the customer after purchase. |
+| `categories` | array | List of categories. See [Product - Categories properties](#product---categories-properties) |
+| `tags` | array | List of tags. See [Product - Tags properties](#product---tags-properties) |
+| `brands` | array | List of product brands. See [Brands Properties](#brands-properties). In write-mode pass an array of brand objects with `id` property ([uses wp_set_object_terms()](http://codex.wordpress.org/Function_Reference/wp_set_object_terms)) |
+| `images` | array | List of images. See [Product - Images properties](#product---images-properties) |
+| `attributes` | array | List of attributes. See [Product - Attributes properties](#product---attributes-properties) |
+| `default_attributes` | array | Defaults variation attributes. See [Product - Default attributes properties](#product---default-attributes-properties) |
+| `variations` | array | List of variations IDs. `READ-ONLY` |
+| `grouped_products` | array | List of grouped products ID. |
+| `menu_order` | integer | Menu order, used to custom sort products. |
+| `meta_data` | array | Meta data. See [Product - Meta data properties](#product---meta-data-properties) |
+
+### Product - Downloads properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ----------- |
+| `id` | string | File ID. |
+| `name` | string | File name. |
+| `file` | string | File URL. |
+
+### Product - Dimensions properties
+
+| Attribute | Type | Description |
+| --------- | ------ | --------------- |
+| `length` | string | Product length. |
+| `width` | string | Product width. |
+| `height` | string | Product height. |
+
+### Product - Categories properties
+
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------------- |
+| `id` | integer | Category ID. |
+| `name` | string | Category name. `READ-ONLY` |
+| `slug` | string | Category slug. `READ-ONLY` |
+
+### Product - Tags properties
+
+| Attribute | Type | Description |
+| --------- | ------- | --------------------------------------------------- |
+| `id` | integer | Tag ID. |
+| `name` | string | Tag name. `READ-ONLY` |
+| `slug` | string | Tag slug. `READ-ONLY` |
+
+### Product - Images properties
+
+| Attribute | Type | Description |
+| ------------------- | --------- | ------------------------------------------------------------------------------------------------------- |
+| `id` | integer | The attachment ID from the Media Library. |
+| `date_created` | date-time | The date the image was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the image was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the image was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the image was last modified, as GMT. `READ-ONLY` |
+| `src` | string | Image URL. |
+| `name` | string | Image name. |
+| `alt` | string | Image alternative text. |
+
+### Brands Properties
+
+| Attribute | Type | Description |
+| --------- | ------- | ---------------------------------------------------------------------- |
+| `id` | integer | Brand ID `REQUIRED FOR WRITE OPERATIONS` |
+| `name` | string | Brand name `READ-ONLY` |
+| `slug` | string | Brand slug `READ-ONLY` |
+
+### Product - Attributes properties
+
+| Attribute | Type | Description |
+| ----------- | ------- | ----------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Attribute ID. |
+| `name` | string | Attribute name. |
+| `position` | integer | Attribute position. |
+| `visible` | boolean | Define if the attribute is visible on the "Additional information" tab in the product's page. Default is `false`. |
+| `variation` | boolean | Define if the attribute can be used as variation. Default is `false`. |
+| `options` | array | List of available term names of the attribute. |
+
+### Product - Default attributes properties
+
+| Attribute | Type | Description |
+| --------- | ------- | ----------------------------- |
+| `id` | integer | Attribute ID. |
+| `name` | string | Attribute name. |
+| `option` | string | Selected attribute term name. |
+
+### Product - Meta data properties
+
+| Attribute | Type | Description |
+| --------- | ------- | -------------------------------------------------- |
+| `id` | integer | Meta ID. `READ-ONLY` |
+| `key` | string | Meta key. |
+| `value` | string | Meta value. |
+
+## Create a product
+
+This API helps you to create a new product.
+
+```http
+POST /wp-json/wc/v3/products
+```
+
+> Example of how to create a `simple` product with one existing image and one new image:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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": [
+ {
+ "id": 42
+ },
+ {
+ "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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: [
+ {
+ id: 42,
+ },
+ {
+ 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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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' => [
+ [
+ 'id': 42
+ ],
+ [
+ 'src' => 'http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg'
+ ]
+ ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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": [
+ {
+ "id": 42
+ },
+ {
+ "src": "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg"
+ }
+ ]
+}
+
+print(wcapi.post("products", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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: [
+ {
+ id: 42
+ },
+ {
+ src: "http://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2013/06/T_2_back.jpg",
+ }
+ ]
+}
+
+woocommerce.post("products", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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": 42,
+ "date_created": "2017-03-22T14:01:13",
+ "date_created_gmt": "2017-03-22T20:01:13",
+ "date_modified": "2017-03-22T14:01:13",
+ "date_modified_gmt": "2017-03-22T20: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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+> Example of how to create a `variable` product with global and non-global attributes:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a product
+
+This API lets you retrieve and view a specific product by ID.
+
+```http
+GET /wp-json/wc/v3/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/794 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products/794' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products/794')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products/794").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products/794").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all products
+
+This API helps you to view all the products.
+
+```http
+GET /wp-json/wc/v3/products
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'products' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('products')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("products").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("products").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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\">$</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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ----------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `search_fields` | array | Fields to search when used with `search` parameter. All search tokens must be found across any of the specified fields. Takes precedence over other search parameters. If empty, uses default `search` behavior. Options: `name`, `sku`, `global_unique_id`, `description`, and `short_description`. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `modified_after` | string | Limit response to resources modified after a given ISO8601 compliant date. |
+| `modified_before` | string | Limit response to resources modified after a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Whether to interpret dates as GMT when limiting response by published or modified date. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title`, `slug`, `price`, `popularity`, `rating`, and `menu_order`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `slug` | string | Limit result set to products with a specific slug. |
+| `status` | string | Limit result set to products assigned a specific status. Options: `any`, `draft`, `pending`, `private` and `publish`. Default is `any`. |
+| `include_status` | string | Limit result set to products with any of the specified statuses. Multiple statuses can be provided as a comma-separated list. Takes precedence over the `status` parameter. Options: `any`, `future`, `trash`, `draft`, `pending`, `private`, and `publish`. |
+| `exclude_status` | string | Exclude products from result set with any of the specified statuses. Multiple statuses can be provided as a comma-separated list. Takes precedence over the `include_status` parameter. Options: `future`, `trash`, `draft`, `pending`, `private`, and `publish`. |
+| `type` | string | Limit result set to products assigned a specific type. Options: `simple`, `grouped`, `external` and `variable`. |
+| `include_types` | string | Limit result set to products with any of the types. Multiple statuses can be provided as a comma-separated list. Takes precedence over the `type` parameter. Options: `simple`, `grouped`, `external` and `variable`. |
+| `exclude_types` | string | Exclude products from result set with any of the specified types. Multiple statuses can be provided as a comma-separated list. Takes precedence over the `include_types` parameter. Options: `simple`, `grouped`, `external` and `variable`. |
+| `sku` | string | Limit result set to products with a specific SKU. |
+| `featured` | boolean | Limit result set to featured products. |
+| `category` | string | Limit result set to products assigned a specific category ID. |
+| `tag` | string | Limit result set to products assigned a specific tag ID. |
+| `shipping_class` | string | Limit result set to products assigned a specific shipping class ID. |
+| `attribute` | string | Limit result set to products with a specific attribute. |
+| `attribute_term` | string | Limit result set to products with a specific attribute term ID (required an assigned attribute). |
+| `tax_class` | string | Limit result set to products with a specific tax class. Default options: `standard`, `reduced-rate` and `zero-rate`. |
+| `on_sale` | boolean | Limit result set to products on sale. |
+| `min_price` | string | Limit result set to products based on a minimum price. |
+| `max_price` | string | Limit result set to products based on a maximum price. |
+| `stock_status` | string | Limit result set to products with specified stock status. Options: `instock`, `outofstock` and `onbackorder`. |
+| `virtual` | boolean | Limit result set to virtual products. |
+| `downloadable` | boolean | Limit result set to downloadable products. |
+
+## Duplicate product
+
+This API helps you to duplicate a product.
+
+```http
+POST /wp-json/wc/v3/products/<product_id>/duplicate
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/products/<product_id>/duplicate \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.post( 'products/2/duplicate' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->post('products/2/duplicate')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.post("products/2/duplicate").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.post("products/2/duplicate").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "id": 824,
+ "name": "Premium Quality (Copy)",
+ "slug": "",
+ "date_created": {
+ "date": "2024-05-30 19:16:39.000000",
+ "timezone_type": 1,
+ "timezone": "+00:00"
+ },
+ "date_modified": {
+ "date": "2024-03-08 15:03:19.000000",
+ "timezone_type": 1,
+ "timezone": "+00:00"
+ },
+ "status": "draft",
+ "featured": false,
+ "catalog_visibility": "visible",
+ "description": "",
+ "short_description": "",
+ "sku": "product-22-1",
+ "price": "",
+ "regular_price": "",
+ "sale_price": "",
+ "date_on_sale_from": null,
+ "date_on_sale_to": null,
+ "total_sales": 0,
+ "tax_status": "taxable",
+ "tax_class": "",
+ "manage_stock": false,
+ "stock_quantity": null,
+ "stock_status": "instock",
+ "backorders": "no",
+ "low_stock_amount": "",
+ "sold_individually": false,
+ "weight": "",
+ "length": "",
+ "width": "",
+ "height": "",
+ "upsell_ids": [],
+ "cross_sell_ids": [],
+ "parent_id": 0,
+ "reviews_allowed": true,
+ "purchase_note": "",
+ "attributes": [],
+ "default_attributes": [],
+ "menu_order": 0,
+ "post_password": "",
+ "virtual": false,
+ "downloadable": false,
+ "category_ids": [ 15 ],
+ "tag_ids": [],
+ "shipping_class_id": 0,
+ "downloads": [],
+ "image_id": "",
+ "gallery_image_ids": [],
+ "download_limit": -1,
+ "download_expiry": -1,
+ "rating_counts": [],
+ "average_rating": "0",
+ "review_count": 0,
+ "meta_data": []
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a product
+
+This API lets you make changes to a product.
+
+```http
+PUT /wp-json/wc/v3/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ regular_price: '24.54',
+};
+
+WooCommerce.put( 'products/794', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'regular_price' => '24.54'
+];
+
+print_r($woocommerce->put('products/794', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "regular_price": "24.54"
+}
+
+print(wcapi.put("products/794", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ regular_price: "24.54"
+}
+
+woocommerce.put("products/794", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a product
+
+This API helps you delete a product.
+
+```http
+DELETE /wp-json/wc/v3/products/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/products/794?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'products/794', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('products/794', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("products/794", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("products/794", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------------------- |
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/products/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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\">$</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\">$</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\">$</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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/refunds.mdx b/docs/apis/rest-api/v3/refunds.mdx
new file mode 100644
index 00000000000..e0ae4f85384
--- /dev/null
+++ b/docs/apis/rest-api/v3/refunds.mdx
@@ -0,0 +1,180 @@
+---
+sidebar_position: 17
+sidebar_label: 'Refunds'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Refunds
+
+The refunds API is a simple, read-only endpoint that allows you to retrieve a list of refunds outside the context of an existing order. To create, view, and delete individual refunds, check out the [order refunds API](../order-refunds).
+
+## Refund properties
+
+All properties are the same as those in the [order refunds endpoint](../order-refunds#order-refund-properties), but with one additional property:
+
+| Attribute | Type | Description |
+| ----------- | ------- | -------------------------------------------------- |
+| `parent_id` | integer | The ID of the order the refund is associated with. |
+
+## Retrieve a list of refunds
+
+This API lets you retrieve and view refunds from your store, regardless of which order they are associated with.
+
+```http
+GET /wp-json/wc/v3/refunds
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/refunds \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'refunds' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('refunds')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("refunds").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("refunds").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "id": 726,
+ "parent_id": 124,
+ "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,
+ "parent_id": 63,
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ---------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `modified`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `parent` | array | Limit result set to those of particular parent IDs. |
+| `parent_exclude` | array | Limit result set to all items except those of a particular parent ID. |
+| `dp` | integer | Number of decimal points to use in each resource. Default is `2`. |
diff --git a/docs/apis/rest-api/v3/reports.mdx b/docs/apis/rest-api/v3/reports.mdx
new file mode 100644
index 00000000000..e004735b1ca
--- /dev/null
+++ b/docs/apis/rest-api/v3/reports.mdx
@@ -0,0 +1,957 @@
+---
+sidebar_position: 16
+sidebar_label: 'Reports'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+GET /wp-json/wc/v3/reports
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/reports \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'reports' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('reports')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("reports").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve sales report
+
+This API lets you retrieve and view a sales report.
+
+```http
+GET /wp-json/wc/v3/reports/sales
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$query = [
+ 'date_min' => '2016-05-03',
+ 'date_max' => '2016-05-04'
+];
+
+print_r($woocommerce->get('reports/sales', $query));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/sales?date_min=2016-05-03&date_max=2016-05-04").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+query = {
+ date_min: "2016-05-03",
+ date_max: "2016-05-04"
+}
+
+woocommerce.get("reports/sales", query).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Sales report properties
+
+| Attribute | Type | Description |
+| ------------------- | ------- | --------------------------------------------------------------------- |
+| `total_sales` | string | Gross sales in the period. `READ-ONLY` |
+| `net_sales` | string | Net sales in the period. `READ-ONLY` |
+| `average_sales` | string | Average net daily sales. `READ-ONLY` |
+| `total_orders` | integer | Total of orders placed. `READ-ONLY` |
+| `total_items` | integer | Total of items purchased. `READ-ONLY` |
+| `total_tax` | string | Total charged for taxes. `READ-ONLY` |
+| `total_shipping` | string | Total charged for shipping. `READ-ONLY` |
+| `total_refunds` | integer | Total of refunded orders. `READ-ONLY` |
+| `total_discount` | integer | Total of coupons used. `READ-ONLY` |
+| `totals_grouped_by` | string | Group type. `READ-ONLY` |
+| `totals` | array | Totals. `READ-ONLY` |
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Default is `view`. Options: `view`. |
+| `period` | string | Report period. Default is today's date. Options: `week`, `month`, `last_month` and `year` |
+| `date_min` | string | Return sales for a specific start date, the date need to be in the YYYY-MM-DD format. |
+| `date_max` | string | Return 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
+GET /wp-json/wc/v3/reports/top_sellers
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/reports/top_sellers?period=last_month \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'reports/top_sellers', {
+ period: 'last_month',
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$query = [
+ 'period' => 'last_month'
+];
+
+print_r($woocommerce->get('reports/top_sellers', $query));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/top_sellers?period=last_month").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+query = {
+ period: "last_month"
+}
+
+woocommerce.get("reports/top_sellers", query).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Top sellers report properties
+
+| Attribute | Type | Description |
+| ------------ | ------- | -------------------------------------------------------------------- |
+| `title` | string | Product title. `READ-ONLY` |
+| `product_id` | integer | Product ID. `READ-ONLY` |
+| `quantity` | integer | Total number of purchases. `READ-ONLY` |
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ---------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Default is `view`. Options: `view`. |
+| `period` | string | Report period. Default is `week`. Options: `week`, `month`, `last_month` and `year` |
+| `date_min` | string | Return sales for a specific start date, the date need to be in the YYYY-MM-DD format. |
+| `date_max` | string | Return 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
+GET /wp-json/wc/v3/reports/coupons/totals
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/reports/coupons/totals \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'reports/coupons/totals' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('reports/coupons/totals'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/coupons/totals").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("reports/coupons/totals").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Coupons totals properties
+
+| Attribute | Type | Description |
+| --------- | ------ | -------------------------------------------------------------------------------------- |
+| `slug` | string | An alphanumeric identifier for the resource. `READ-ONLY` |
+| `name` | string | Coupon type name. `READ-ONLY` |
+| `total` | string | Amount of coupons. `READ-ONLY` |
+
+## Retrieve customers totals
+
+This API lets you retrieve and view customers totals report.
+
+```http
+GET /wp-json/wc/v3/reports/customers/totals
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/reports/customers/totals \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'reports/customers/totals' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('reports/customers/totals'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/customers/totals").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("reports/customers/totals").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "slug": "paying",
+ "name": "Paying customer",
+ "total": 2
+ },
+ {
+ "slug": "non_paying",
+ "name": "Non-paying customer",
+ "total": 1
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Customers totals properties
+
+| Attribute | Type | Description |
+| --------- | ------ | -------------------------------------------------------------------------------------- |
+| `slug` | string | An alphanumeric identifier for the resource. `READ-ONLY` |
+| `name` | string | Customer type name. `READ-ONLY` |
+| `total` | string | Amount of customers. `READ-ONLY` |
+
+## Retrieve orders totals
+
+This API lets you retrieve and view orders totals report.
+
+```http
+GET /wp-json/wc/v3/reports/orders/totals
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/reports/orders/totals \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'reports/orders/totals' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('reports/orders/totals'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/orders/totals").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("reports/orders/totals").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Orders totals properties
+
+| Attribute | Type | Description |
+| --------- | ------ | -------------------------------------------------------------------------------------- |
+| `slug` | string | An alphanumeric identifier for the resource. `READ-ONLY` |
+| `name` | string | Orders status name. `READ-ONLY` |
+| `total` | string | Amount of orders. `READ-ONLY` |
+
+## Retrieve products totals
+
+This API lets you retrieve and view products totals report.
+
+```http
+GET /wp-json/wc/v3/reports/products/totals
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/reports/products/totals \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'reports/products/totals' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('reports/products/totals'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/products/totals").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("reports/products/totals").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Products totals properties
+
+| Attribute | Type | Description |
+| --------- | ------ | -------------------------------------------------------------------------------------- |
+| `slug` | string | An alphanumeric identifier for the resource. `READ-ONLY` |
+| `name` | string | Product type name. `READ-ONLY` |
+| `total` | string | Amount of products. `READ-ONLY` |
+
+## Retrieve reviews totals
+
+This API lets you retrieve and view reviews totals report.
+
+```http
+GET /wp-json/wc/v3/reports/reviews/totals
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/reports/reviews/totals \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'reports/reviews/totals' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+print_r($woocommerce->get('reports/reviews/totals'));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("reports/reviews/totals").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("reports/reviews/totals").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Reviews totals properties
+
+| Attribute | Type | Description |
+| --------- | ------ | -------------------------------------------------------------------------------------- |
+| `slug` | string | An alphanumeric identifier for the resource. `READ-ONLY` |
+| `name` | string | Review type name. `READ-ONLY` |
+| `total` | string | Amount of reviews. `READ-ONLY` |
diff --git a/docs/apis/rest-api/v3/setting-options.mdx b/docs/apis/rest-api/v3/setting-options.mdx
new file mode 100644
index 00000000000..9da4b4be38d
--- /dev/null
+++ b/docs/apis/rest-api/v3/setting-options.mdx
@@ -0,0 +1,1948 @@
+---
+sidebar_position: 22
+sidebar_label: 'Setting Options'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Setting options
+
+## Setting option properties
+
+| Attribute | Type | Description |
+| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier for the setting. `READ-ONLY` |
+| `label` | string | A human readable label for the setting used in interfaces. `READ-ONLY` |
+| `description` | string | A human readable description for the setting used in interfaces. `READ-ONLY` |
+| `value` | mixed | Setting value. |
+| `default` | mixed | Default value for the setting. `READ-ONLY` |
+| `tip` | string | Additional help text shown to the user about the setting. `READ-ONLY` |
+| `placeholder` | string | Placeholder text to be displayed in text inputs. `READ-ONLY` |
+| `type` | string | Type of setting. Options: `text`, `email`, `number`, `color`, `password`, `textarea`, `select`, `multiselect`, `radio`, `image_width` and `checkbox`. `READ-ONLY` |
+| `options` | object | Array of options (key value pairs) for inputs such as select, multiselect, and radio buttons. `READ-ONLY` |
+| `group_id` | string | An 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
+GET /wp-json/wc/v3/settings/<group_id>/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/settings/general/woocommerce_allowed_countries \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'settings/general/woocommerce_allowed_countries' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('settings/general/woocommerce_allowed_countries')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("settings/general/woocommerce_allowed_countries").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("settings/general/woocommerce_allowed_countries").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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…",
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all setting options
+
+This API helps you to view all the setting options.
+
+```http
+GET /wp-json/wc/v3/settings/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/settings/general \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'settings/general' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('settings/general')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("settings/general").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("settings/general").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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…",
+ "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…",
+ "description": "",
+ "type": "multiselect",
+ "default": "",
+ "value": "",
+ "options": {
+ "AX": "Å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ç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ão Tomé and Príncipe",
+ "BL": "Saint Barthé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": "Å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ç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ão Tomé and Príncipe",
+ "BL": "Saint Barthé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 & 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": "Å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ç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ão Tomé and Príncipe",
+ "BL": "Saint Barthé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 — no orders shall be fulfilled.",
+ "value": "This is a demo store for testing purposes — 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 (د.إ)",
+ "AFN": "Afghan afghani (؋)",
+ "ALL": "Albanian lek (L)",
+ "AMD": "Armenian dram (AMD)",
+ "ANG": "Netherlands Antillean guilder (ƒ)",
+ "AOA": "Angolan kwanza (Kz)",
+ "ARS": "Argentine peso ($)",
+ "AUD": "Australian dollar ($)",
+ "AWG": "Aruban florin (ƒ)",
+ "AZN": "Azerbaijani manat (AZN)",
+ "BAM": "Bosnia and Herzegovina convertible mark (KM)",
+ "BBD": "Barbadian dollar ($)",
+ "BDT": "Bangladeshi taka (৳ )",
+ "BGN": "Bulgarian lev (лв.)",
+ "BHD": "Bahraini dinar (.د.ب)",
+ "BIF": "Burundian franc (Fr)",
+ "BMD": "Bermudian dollar ($)",
+ "BND": "Brunei dollar ($)",
+ "BOB": "Bolivian boliviano (Bs.)",
+ "BRL": "Brazilian real (R$)",
+ "BSD": "Bahamian dollar ($)",
+ "BTC": "Bitcoin (฿)",
+ "BTN": "Bhutanese ngultrum (Nu.)",
+ "BWP": "Botswana pula (P)",
+ "BYR": "Belarusian ruble (Br)",
+ "BZD": "Belize dollar ($)",
+ "CAD": "Canadian dollar ($)",
+ "CDF": "Congolese franc (Fr)",
+ "CHF": "Swiss franc (CHF)",
+ "CLP": "Chilean peso ($)",
+ "CNY": "Chinese yuan (¥)",
+ "COP": "Colombian peso ($)",
+ "CRC": "Costa Rican colón (₡)",
+ "CUC": "Cuban convertible peso ($)",
+ "CUP": "Cuban peso ($)",
+ "CVE": "Cape Verdean escudo ($)",
+ "CZK": "Czech koruna (Kč)",
+ "DJF": "Djiboutian franc (Fr)",
+ "DKK": "Danish krone (DKK)",
+ "DOP": "Dominican peso (RD$)",
+ "DZD": "Algerian dinar (د.ج)",
+ "EGP": "Egyptian pound (EGP)",
+ "ERN": "Eritrean nakfa (Nfk)",
+ "ETB": "Ethiopian birr (Br)",
+ "EUR": "Euro (€)",
+ "FJD": "Fijian dollar ($)",
+ "FKP": "Falkland Islands pound (£)",
+ "GBP": "Pound sterling (£)",
+ "GEL": "Georgian lari (ლ)",
+ "GGP": "Guernsey pound (£)",
+ "GHS": "Ghana cedi (₵)",
+ "GIP": "Gibraltar pound (£)",
+ "GMD": "Gambian dalasi (D)",
+ "GNF": "Guinean franc (Fr)",
+ "GTQ": "Guatemalan quetzal (Q)",
+ "GYD": "Guyanese dollar ($)",
+ "HKD": "Hong Kong dollar ($)",
+ "HNL": "Honduran lempira (L)",
+ "HRK": "Croatian kuna (Kn)",
+ "HTG": "Haitian gourde (G)",
+ "HUF": "Hungarian forint (Ft)",
+ "IDR": "Indonesian rupiah (Rp)",
+ "ILS": "Israeli new shekel (₪)",
+ "IMP": "Manx pound (£)",
+ "INR": "Indian rupee (₹)",
+ "IQD": "Iraqi dinar (ع.د)",
+ "IRR": "Iranian rial (﷼)",
+ "IRT": "Iranian toman (تومان)",
+ "ISK": "Icelandic króna (kr.)",
+ "JEP": "Jersey pound (£)",
+ "JMD": "Jamaican dollar ($)",
+ "JOD": "Jordanian dinar (د.ا)",
+ "JPY": "Japanese yen (¥)",
+ "KES": "Kenyan shilling (KSh)",
+ "KGS": "Kyrgyzstani som (сом)",
+ "KHR": "Cambodian riel (៛)",
+ "KMF": "Comorian franc (Fr)",
+ "KPW": "North Korean won (₩)",
+ "KRW": "South Korean won (₩)",
+ "KWD": "Kuwaiti dinar (د.ك)",
+ "KYD": "Cayman Islands dollar ($)",
+ "KZT": "Kazakhstani tenge (KZT)",
+ "LAK": "Lao kip (₭)",
+ "LBP": "Lebanese pound (ل.ل)",
+ "LKR": "Sri Lankan rupee (රු)",
+ "LRD": "Liberian dollar ($)",
+ "LSL": "Lesotho loti (L)",
+ "LYD": "Libyan dinar (ل.د)",
+ "MAD": "Moroccan dirham (د.م.)",
+ "MDL": "Moldovan leu (MDL)",
+ "MGA": "Malagasy ariary (Ar)",
+ "MKD": "Macedonian denar (ден)",
+ "MMK": "Burmese kyat (Ks)",
+ "MNT": "Mongolian tögrög (₮)",
+ "MOP": "Macanese pataca (P)",
+ "MRO": "Mauritanian ouguiya (UM)",
+ "MUR": "Mauritian rupee (₨)",
+ "MVR": "Maldivian rufiyaa (.ރ)",
+ "MWK": "Malawian kwacha (MK)",
+ "MXN": "Mexican peso ($)",
+ "MYR": "Malaysian ringgit (RM)",
+ "MZN": "Mozambican metical (MT)",
+ "NAD": "Namibian dollar ($)",
+ "NGN": "Nigerian naira (₦)",
+ "NIO": "Nicaraguan córdoba (C$)",
+ "NOK": "Norwegian krone (kr)",
+ "NPR": "Nepalese rupee (₨)",
+ "NZD": "New Zealand dollar ($)",
+ "OMR": "Omani rial (ر.ع.)",
+ "PAB": "Panamanian balboa (B/.)",
+ "PEN": "Peruvian nuevo sol (S/.)",
+ "PGK": "Papua New Guinean kina (K)",
+ "PHP": "Philippine peso (₱)",
+ "PKR": "Pakistani rupee (₨)",
+ "PLN": "Polish złoty (zł)",
+ "PRB": "Transnistrian ruble (р.)",
+ "PYG": "Paraguayan guaraní (₲)",
+ "QAR": "Qatari riyal (ر.ق)",
+ "RON": "Romanian leu (lei)",
+ "RSD": "Serbian dinar (дин.)",
+ "RUB": "Russian ruble (₽)",
+ "RWF": "Rwandan franc (Fr)",
+ "SAR": "Saudi riyal (ر.س)",
+ "SBD": "Solomon Islands dollar ($)",
+ "SCR": "Seychellois rupee (₨)",
+ "SDG": "Sudanese pound (ج.س.)",
+ "SEK": "Swedish krona (kr)",
+ "SGD": "Singapore dollar ($)",
+ "SHP": "Saint Helena pound (£)",
+ "SLL": "Sierra Leonean leone (Le)",
+ "SOS": "Somali shilling (Sh)",
+ "SRD": "Surinamese dollar ($)",
+ "SSP": "South Sudanese pound (£)",
+ "STD": "São Tomé and Príncipe dobra (Db)",
+ "SYP": "Syrian pound (ل.س)",
+ "SZL": "Swazi lilangeni (L)",
+ "THB": "Thai baht (฿)",
+ "TJS": "Tajikistani somoni (ЅМ)",
+ "TMT": "Turkmenistan manat (m)",
+ "TND": "Tunisian dinar (د.ت)",
+ "TOP": "Tongan paʻanga (T$)",
+ "TRY": "Turkish lira (₺)",
+ "TTD": "Trinidad and Tobago dollar ($)",
+ "TWD": "New Taiwan dollar (NT$)",
+ "TZS": "Tanzanian shilling (Sh)",
+ "UAH": "Ukrainian hryvnia (₴)",
+ "UGX": "Ugandan shilling (UGX)",
+ "USD": "United States dollar ($)",
+ "UYU": "Uruguayan peso ($)",
+ "UZS": "Uzbekistani som (UZS)",
+ "VEF": "Venezuelan bolívar (Bs F)",
+ "VND": "Vietnamese đồng (₫)",
+ "VUV": "Vanuatu vatu (Vt)",
+ "WST": "Samoan tālā (T)",
+ "XAF": "Central African CFA franc (Fr)",
+ "XCD": "East Caribbean dollar ($)",
+ "XOF": "West African CFA franc (Fr)",
+ "XPF": "CFP franc (Fr)",
+ "YER": "Yemeni rial (﷼)",
+ "ZAR": "South African rand (R)",
+ "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 ($99.99)",
+ "right": "Right (99.99$)",
+ "left_space": "Left with space ($ 99.99)",
+ "right_space": "Right with space (99.99 $)"
+ },
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a setting option
+
+This API lets you make changes to a setting option.
+
+```http
+PUT /wp-json/wc/v3/settings/<group_id>/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'value' => 'all_except'
+];
+
+print_r($woocommerce->put('settings/general/woocommerce_allowed_countries', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "value": "all_except"
+}
+
+print(wcapi.put("settings/general/woocommerce_allowed_countries", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ value: "all_except"
+}
+
+woocommerce.put("settings/general/woocommerce_allowed_countries", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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…",
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Batch update setting options
+
+This API helps you to batch update multiple setting options.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/settings/<id>/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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…",
+ "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 (د.إ)",
+ "AFN": "Afghan afghani (؋)",
+ "ALL": "Albanian lek (L)",
+ "AMD": "Armenian dram (AMD)",
+ "ANG": "Netherlands Antillean guilder (ƒ)",
+ "AOA": "Angolan kwanza (Kz)",
+ "ARS": "Argentine peso ($)",
+ "AUD": "Australian dollar ($)",
+ "AWG": "Aruban florin (ƒ)",
+ "AZN": "Azerbaijani manat (AZN)",
+ "BAM": "Bosnia and Herzegovina convertible mark (KM)",
+ "BBD": "Barbadian dollar ($)",
+ "BDT": "Bangladeshi taka (৳ )",
+ "BGN": "Bulgarian lev (лв.)",
+ "BHD": "Bahraini dinar (.د.ب)",
+ "BIF": "Burundian franc (Fr)",
+ "BMD": "Bermudian dollar ($)",
+ "BND": "Brunei dollar ($)",
+ "BOB": "Bolivian boliviano (Bs.)",
+ "BRL": "Brazilian real (R$)",
+ "BSD": "Bahamian dollar ($)",
+ "BTC": "Bitcoin (฿)",
+ "BTN": "Bhutanese ngultrum (Nu.)",
+ "BWP": "Botswana pula (P)",
+ "BYR": "Belarusian ruble (Br)",
+ "BZD": "Belize dollar ($)",
+ "CAD": "Canadian dollar ($)",
+ "CDF": "Congolese franc (Fr)",
+ "CHF": "Swiss franc (CHF)",
+ "CLP": "Chilean peso ($)",
+ "CNY": "Chinese yuan (¥)",
+ "COP": "Colombian peso ($)",
+ "CRC": "Costa Rican colón (₡)",
+ "CUC": "Cuban convertible peso ($)",
+ "CUP": "Cuban peso ($)",
+ "CVE": "Cape Verdean escudo ($)",
+ "CZK": "Czech koruna (Kč)",
+ "DJF": "Djiboutian franc (Fr)",
+ "DKK": "Danish krone (DKK)",
+ "DOP": "Dominican peso (RD$)",
+ "DZD": "Algerian dinar (د.ج)",
+ "EGP": "Egyptian pound (EGP)",
+ "ERN": "Eritrean nakfa (Nfk)",
+ "ETB": "Ethiopian birr (Br)",
+ "EUR": "Euro (€)",
+ "FJD": "Fijian dollar ($)",
+ "FKP": "Falkland Islands pound (£)",
+ "GBP": "Pound sterling (£)",
+ "GEL": "Georgian lari (ლ)",
+ "GGP": "Guernsey pound (£)",
+ "GHS": "Ghana cedi (₵)",
+ "GIP": "Gibraltar pound (£)",
+ "GMD": "Gambian dalasi (D)",
+ "GNF": "Guinean franc (Fr)",
+ "GTQ": "Guatemalan quetzal (Q)",
+ "GYD": "Guyanese dollar ($)",
+ "HKD": "Hong Kong dollar ($)",
+ "HNL": "Honduran lempira (L)",
+ "HRK": "Croatian kuna (Kn)",
+ "HTG": "Haitian gourde (G)",
+ "HUF": "Hungarian forint (Ft)",
+ "IDR": "Indonesian rupiah (Rp)",
+ "ILS": "Israeli new shekel (₪)",
+ "IMP": "Manx pound (£)",
+ "INR": "Indian rupee (₹)",
+ "IQD": "Iraqi dinar (ع.د)",
+ "IRR": "Iranian rial (﷼)",
+ "IRT": "Iranian toman (تومان)",
+ "ISK": "Icelandic króna (kr.)",
+ "JEP": "Jersey pound (£)",
+ "JMD": "Jamaican dollar ($)",
+ "JOD": "Jordanian dinar (د.ا)",
+ "JPY": "Japanese yen (¥)",
+ "KES": "Kenyan shilling (KSh)",
+ "KGS": "Kyrgyzstani som (сом)",
+ "KHR": "Cambodian riel (៛)",
+ "KMF": "Comorian franc (Fr)",
+ "KPW": "North Korean won (₩)",
+ "KRW": "South Korean won (₩)",
+ "KWD": "Kuwaiti dinar (د.ك)",
+ "KYD": "Cayman Islands dollar ($)",
+ "KZT": "Kazakhstani tenge (KZT)",
+ "LAK": "Lao kip (₭)",
+ "LBP": "Lebanese pound (ل.ل)",
+ "LKR": "Sri Lankan rupee (රු)",
+ "LRD": "Liberian dollar ($)",
+ "LSL": "Lesotho loti (L)",
+ "LYD": "Libyan dinar (ل.د)",
+ "MAD": "Moroccan dirham (د.م.)",
+ "MDL": "Moldovan leu (MDL)",
+ "MGA": "Malagasy ariary (Ar)",
+ "MKD": "Macedonian denar (ден)",
+ "MMK": "Burmese kyat (Ks)",
+ "MNT": "Mongolian tögrög (₮)",
+ "MOP": "Macanese pataca (P)",
+ "MRO": "Mauritanian ouguiya (UM)",
+ "MUR": "Mauritian rupee (₨)",
+ "MVR": "Maldivian rufiyaa (.ރ)",
+ "MWK": "Malawian kwacha (MK)",
+ "MXN": "Mexican peso ($)",
+ "MYR": "Malaysian ringgit (RM)",
+ "MZN": "Mozambican metical (MT)",
+ "NAD": "Namibian dollar ($)",
+ "NGN": "Nigerian naira (₦)",
+ "NIO": "Nicaraguan córdoba (C$)",
+ "NOK": "Norwegian krone (kr)",
+ "NPR": "Nepalese rupee (₨)",
+ "NZD": "New Zealand dollar ($)",
+ "OMR": "Omani rial (ر.ع.)",
+ "PAB": "Panamanian balboa (B/.)",
+ "PEN": "Peruvian nuevo sol (S/.)",
+ "PGK": "Papua New Guinean kina (K)",
+ "PHP": "Philippine peso (₱)",
+ "PKR": "Pakistani rupee (₨)",
+ "PLN": "Polish złoty (zł)",
+ "PRB": "Transnistrian ruble (р.)",
+ "PYG": "Paraguayan guaraní (₲)",
+ "QAR": "Qatari riyal (ر.ق)",
+ "RON": "Romanian leu (lei)",
+ "RSD": "Serbian dinar (дин.)",
+ "RUB": "Russian ruble (₽)",
+ "RWF": "Rwandan franc (Fr)",
+ "SAR": "Saudi riyal (ر.س)",
+ "SBD": "Solomon Islands dollar ($)",
+ "SCR": "Seychellois rupee (₨)",
+ "SDG": "Sudanese pound (ج.س.)",
+ "SEK": "Swedish krona (kr)",
+ "SGD": "Singapore dollar ($)",
+ "SHP": "Saint Helena pound (£)",
+ "SLL": "Sierra Leonean leone (Le)",
+ "SOS": "Somali shilling (Sh)",
+ "SRD": "Surinamese dollar ($)",
+ "SSP": "South Sudanese pound (£)",
+ "STD": "São Tomé and Príncipe dobra (Db)",
+ "SYP": "Syrian pound (ل.س)",
+ "SZL": "Swazi lilangeni (L)",
+ "THB": "Thai baht (฿)",
+ "TJS": "Tajikistani somoni (ЅМ)",
+ "TMT": "Turkmenistan manat (m)",
+ "TND": "Tunisian dinar (د.ت)",
+ "TOP": "Tongan paʻanga (T$)",
+ "TRY": "Turkish lira (₺)",
+ "TTD": "Trinidad and Tobago dollar ($)",
+ "TWD": "New Taiwan dollar (NT$)",
+ "TZS": "Tanzanian shilling (Sh)",
+ "UAH": "Ukrainian hryvnia (₴)",
+ "UGX": "Ugandan shilling (UGX)",
+ "USD": "United States dollar ($)",
+ "UYU": "Uruguayan peso ($)",
+ "UZS": "Uzbekistani som (UZS)",
+ "VEF": "Venezuelan bolívar (Bs F)",
+ "VND": "Vietnamese đồng (₫)",
+ "VUV": "Vanuatu vatu (Vt)",
+ "WST": "Samoan tālā (T)",
+ "XAF": "Central African CFA franc (Fr)",
+ "XCD": "East Caribbean dollar ($)",
+ "XOF": "West African CFA franc (Fr)",
+ "XPF": "CFP franc (Fr)",
+ "YER": "Yemeni rial (﷼)",
+ "ZAR": "South African rand (R)",
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/settings.mdx b/docs/apis/rest-api/v3/settings.mdx
new file mode 100644
index 00000000000..2b783085aa5
--- /dev/null
+++ b/docs/apis/rest-api/v3/settings.mdx
@@ -0,0 +1,374 @@
+---
+sidebar_position: 21
+sidebar_label: 'Settings'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Settings
+
+The settings API allows you to view all groups of settings available.
+
+## Setting group properties
+
+| Attribute | Type | Description |
+| ------------- | ------ | ---------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier that can be used to link settings together. `READ-ONLY` |
+| `label` | string | A human readable label for the setting used in interfaces. `READ-ONLY` |
+| `description` | string | A human readable description for the setting used in interfaces. `READ-ONLY` |
+| `parent_id` | string | ID of parent grouping. `READ-ONLY` |
+| `sub_groups` | string | IDs for settings sub groups. `READ-ONLY` |
+
+## List all settings groups
+
+This API helps you to view all the settings groups.
+
+```http
+GET /wp-json/wc/v3/settings
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/settings \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'settings' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('settings')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("settings").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("settings").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/shipping-methods.mdx b/docs/apis/rest-api/v3/shipping-methods.mdx
new file mode 100644
index 00000000000..ed02fe1f424
--- /dev/null
+++ b/docs/apis/rest-api/v3/shipping-methods.mdx
@@ -0,0 +1,207 @@
+---
+sidebar_position: 27
+sidebar_label: 'Shipping Methods'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Shipping methods
+
+The shipping methods API allows you to view individual shipping methods.
+
+## Shipping method properties
+
+| Attribute | Type | Description |
+| ------------- | ------ | ---------------------------------------------------------------------- |
+| `id` | string | Method ID. `READ-ONLY` |
+| `title` | string | Shipping method title. `READ-ONLY` |
+| `description` | string | Shipping method description. `READ-ONLY` |
+
+## Retrieve a shipping method
+
+This API lets you retrieve and view a specific shipping method.
+
+```http
+GET /wp-json/wc/v3/shipping_methods/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/shipping_methods/flat_rate \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'shipping_methods/flat_rate' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping_methods/flat_rate')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping_methods/flat_rate").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping_methods/flat_rate").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping methods
+
+This API helps you to view all the shipping methods.
+
+```http
+GET /wp-json/wc/v3/shipping_methods
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/shipping_methods \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'shipping_methods' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping_methods')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping_methods").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping_methods").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/shipping-zone-locations.mdx b/docs/apis/rest-api/v3/shipping-zone-locations.mdx
new file mode 100644
index 00000000000..a05bba61333
--- /dev/null
+++ b/docs/apis/rest-api/v3/shipping-zone-locations.mdx
@@ -0,0 +1,245 @@
+---
+sidebar_position: 25
+sidebar_label: 'Shipping Zone Locations'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Shipping zone locations
+
+The shipping zone locations API allows you to view and batch update locations of a shipping zone.
+
+## Shipping location properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ----------------------------------------------------------------------------------------------------------- |
+| `code` | string | Shipping zone location code. |
+| `type` | string | Shipping 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
+GET /wp-json/wc/v3/shipping/zones/<id>/locations
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/shipping/zones/5/locations \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'shipping/zones/5/locations' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones/5/locations')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones/5/locations").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones/5/locations").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a locations of a shipping zone
+
+This API lets you make changes to locations of a shipping zone.
+
+```http
+PUT /wp-json/wc/v3/shipping/zones/<id>/locations
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+]'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ [
+ 'code' => 'BR:SP',
+ 'type' => 'state'
+ ],
+ [
+ 'code' => 'BR:RJ',
+ 'type' => 'state'
+ ]
+];
+
+print_r($woocommerce->put('shipping/zones/5/locations', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = [
+ {
+ "code": "BR:SP",
+ "type": "state"
+ },
+ {
+ "code": "BR:RJ",
+ "type": "state"
+ }
+]
+
+print(wcapi.put("shipping/zones/5/locations", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = [
+ {
+ code: "BR:SP",
+ type: "state"
+ },
+ {
+ code: "BR:RJ",
+ type: "state"
+ }
+]
+
+woocommerce.put("shipping/zones/5/locations", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/shipping-zone-methods.mdx b/docs/apis/rest-api/v3/shipping-zone-methods.mdx
new file mode 100644
index 00000000000..e4e2b8a707b
--- /dev/null
+++ b/docs/apis/rest-api/v3/shipping-zone-methods.mdx
@@ -0,0 +1,1041 @@
+---
+sidebar_position: 26
+sidebar_label: 'Shipping Zone Methods'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+
+| Attribute | Type | Description |
+| -------------------- | ------- | ----------------------------------------------------------------------------------------------------------- |
+| `instance_id` | integer | Shipping method instance ID. `READ-ONLY` |
+| `title` | string | Shipping method customer facing title. `READ-ONLY` |
+| `order` | integer | Shipping method sort order. |
+| `enabled` | boolean | Shipping method enabled status. |
+| `method_id` | string | Shipping method ID. `READ-ONLY` `MANDATORY` |
+| `method_title` | string | Shipping method title. `READ-ONLY` |
+| `method_description` | string | Shipping method description. `READ-ONLY` |
+| `settings` | object | Shipping method settings. See [Shipping method - Settings properties](#shipping-method---settings-properties) |
+
+### Shipping method - Settings properties
+
+| Attribute | Type | Description |
+| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier for the setting. `READ-ONLY` |
+| `label` | string | A human readable label for the setting used in interfaces. `READ-ONLY` |
+| `description` | string | A human readable description for the setting used in interfaces. `READ-ONLY` |
+| `type` | string | Type of setting. Options: `text`, `email`, `number`, `color`, `password`, `textarea`, `select`, `multiselect`, `radio`, `image_width` and `checkbox`. `READ-ONLY` |
+| `value` | string | Setting value. |
+| `default` | string | Default value for the setting. `READ-ONLY` |
+| `tip` | string | Additional help text shown to the user about the setting. `READ-ONLY` |
+| `placeholder` | string | Placeholder 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
+POST /wp-json/wc/v3/shipping/zones/<id>/methods
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'method_id' => 'flat_rate'
+];
+
+print_r($woocommerce->post('shipping/zones/5/methods', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "method_id": "flat_rate"
+}
+
+print(wcapi.post("shipping/zones/5/methods", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ method_id: "flat_rate"
+}
+
+woocommerce.post("shipping/zones/5/methods", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## 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
+GET /wp-json/wc/v3/shipping/zones/<zone_id>/methods/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'shipping/zones/5/methods/26' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones/5/methods/26')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones/5/methods/26").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones/5/methods/26").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping methods from a shipping zone
+
+This API helps you to view all the shipping methods from a shipping zone.
+
+```http
+GET /wp-json/wc/v3/shipping/zones/<id>/methods
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/shipping/zones/5/methods \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'shipping/zones/5/methods' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones/5/methods')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones/5/methods").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones/5/methods").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a shipping method of a shipping zone
+
+This API lets you make changes to a shipping method of a shipping zone.
+
+```http
+PUT /wp-json/wc/v3/shipping/zones/<zone_id>/methods/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+ }
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'settings' => [
+ 'cost' => '20.00'
+ ]
+];
+
+print_r($woocommerce->put('shipping/zones/5/methods/26', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "settings": {
+ "cost": "20.00"
+ }
+}
+
+print(wcapi.put("shipping/zones/5/methods/26", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ settings: {
+ "cost": "20.00"
+ }
+}
+
+woocommerce.put("shipping/zones/5/methods/26", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a shipping method from a shipping zone
+
+This API helps you delete a shipping method from a shipping zone.
+
+```http
+DELETE /wp-json/wc/v3/shipping/zones/<zone_id>/methods/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/shipping/zones/5/methods/26?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'shipping/zones/5/methods/26', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('shipping/zones/5/methods/26', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("shipping/zones/5/methods/26", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("shipping/zones/5/methods/26", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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§ion=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§ion=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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v3/shipping-zones.mdx b/docs/apis/rest-api/v3/shipping-zones.mdx
new file mode 100644
index 00000000000..8abbb7c3190
--- /dev/null
+++ b/docs/apis/rest-api/v3/shipping-zones.mdx
@@ -0,0 +1,500 @@
+---
+sidebar_position: 24
+sidebar_label: 'Shipping Zones'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Shipping zones
+
+The shipping zones API allows you to create, view, update, and delete individual shipping zones.
+
+## Shipping zone properties
+
+| Attribute | Type | Description |
+| --------- | ------- | ----------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Shipping zone name. `MANDATORY` |
+| `order` | integer | Shipping zone order. |
+
+## Create a shipping zone
+
+This API helps you to create a new shipping zone.
+
+```http
+POST /wp-json/wc/v3/shipping/zones
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: 'Brazil',
+};
+
+WooCommerce.post( 'shipping/zones', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Brazil'
+];
+
+print_r($woocommerce->post('shipping/zones', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Brazil"
+}
+
+print(wcapi.post("shipping/zones", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Brazil"
+}
+
+woocommerce.post("shipping/zones", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a shipping zone
+
+This API lets you retrieve and view a specific shipping zone by ID.
+
+```http
+GET /wp-json/wc/v3/shipping/zones/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/shipping/zones/5 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'shipping/zones/5' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones/5')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones/5").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones/5").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all shipping zones
+
+This API helps you to view all the shipping zones.
+
+```http
+GET /wp-json/wc/v3/shipping/zones
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/shipping/zones \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'shipping/zones' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('shipping/zones')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("shipping/zones").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("shipping/zones").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Update a shipping zone
+
+This API lets you make changes to a shipping zone.
+
+```http
+PUT /wp-json/wc/v3/shipping/zones/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ order: 1,
+};
+
+WooCommerce.put( 'shipping/zones/5', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'order' => 1
+];
+
+print_r($woocommerce->put('shipping/zones/5', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "order": 1
+}
+
+print(wcapi.put("shipping/zones/5", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ order: 1
+}
+
+woocommerce.put("shipping/zones/5", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a shipping zone
+
+This API helps you delete a shipping zone.
+
+```http
+DELETE /wp-json/wc/v3/shipping/zones/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/shipping/zones/5?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'shipping/zones/5', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('shipping/zones/5', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("shipping/zones/5", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("shipping/zones/5", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required to be `true`, as resource does not support trashing. |
diff --git a/docs/apis/rest-api/v3/system-status-tools.mdx b/docs/apis/rest-api/v3/system-status-tools.mdx
new file mode 100644
index 00000000000..edfabe3a711
--- /dev/null
+++ b/docs/apis/rest-api/v3/system-status-tools.mdx
@@ -0,0 +1,568 @@
+---
+sidebar_position: 29
+sidebar_label: 'System Status Tools'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# System status tools
+
+The system status tools API allows you to view and run tools from system status.
+
+## System status tool properties
+
+| Attribute | Type | Description |
+| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------- |
+| `id` | string | A unique identifier for the tool. `READ-ONLY` |
+| `name` | string | Tool name. `READ-ONLY` |
+| `action` | string | What running the tool will do. `READ-ONLY` |
+| `description` | string | Tool description. `READ-ONLY` |
+| `success` | boolean | Did the tool run successfully? `READ-ONLY` `WRITE-ONLY` |
+| `message` | string | Tool return message. `READ-ONLY` `WRITE-ONLY` |
+| `confirm` | boolean | Confirm 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
+GET /wp-json/wc/v3/system_status/tools/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/system_status/tools/clear_transients \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'system_status/tools/clear_transients' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('system_status/tools/clear_transients')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("system_status/tools/clear_transients").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("system_status/tools/clear_transients").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all tools from system status
+
+This API helps you to view all tools from system status.
+
+```http
+GET /wp-json/wc/v3/system_status/tools
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/system_status/tools \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'system_status/tools' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('system_status/tools')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("system_status/tools").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("system_status/tools").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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": "clear_expired_download_permissions",
+ "name": "Used-up download permissions",
+ "action": "Clean up download permissions",
+ "description": "This tool will delete expired download permissions and permissions with 0 remaining downloads.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/clear_expired_download_permissions"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "regenerate_product_lookup_tables",
+ "name": "Product lookup tables",
+ "action": "Regenerate",
+ "description": "This tool will regenerate product lookup table data. This process may take a while.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/regenerate_product_lookup_tables"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "repair_coupons_lookup_table",
+ "name": "Coupons lookup table",
+ "action": "Repair",
+ "description": "This tool will repair the coupons lookup table data with missing discount amounts. This process may take a while.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/repair_coupons_lookup_table"
+ }
+ ],
+ "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": "clear_template_cache",
+ "name": "Clear template cache",
+ "action": "Clear",
+ "description": "<strong class=\"red\">Note:</strong> This tool will empty the template cache.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/clear_template_cache"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "clear_system_status_theme_info_cache",
+ "name": "Clear system status theme info cache",
+ "action": "Clear",
+ "description": "<strong class=\"red\">Note:</strong> This tool will empty the system status theme info cache.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/clear_system_status_theme_info_cache"
+ }
+ ],
+ "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": "regenerate_thumbnails",
+ "name": "Regenerate shop thumbnails",
+ "action": "Regenerate",
+ "description": "This will regenerate all shop thumbnails to match your theme and/or image settings.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/regenerate_thumbnails"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "db_update_routine",
+ "name": "Update database",
+ "action": "Update database",
+ "description": "<strong class=\"red\">Note:</strong> This tool will update your WooCommerce database to the latest version. Please ensure you make sufficient backups before proceeding.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/db_update_routine"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "recreate_order_address_fts_index",
+ "name": "Re-create Order Address FTS index",
+ "action": "Recreate index",
+ "description": "This tool will recreate the full text search index for order addresses. If the index does not exist, it will try to create it.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/recreate_order_address_fts_index"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+ }
+ ]
+ }
+ },
+ {
+ "id": "verify_db_tables",
+ "name": "Verify base database tables",
+ "action": "Verify database",
+ "description": "Verify if all base database tables are present.",
+ "_links": {
+ "self": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools/verify_db_tables"
+ }
+ ],
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/system_status/tools"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Run a tool from system status
+
+This API lets you run a tool from system status.
+
+```http
+PUT /wp-json/wc/v3/system_status/tools/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'confirm' => true
+];
+
+print_r($woocommerce->put('system_status/tools/clear_transients', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "confirm": True
+}
+
+print(wcapi.put("system_status/tools/clear_transients", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ confirm: true
+}
+
+woocommerce.put("system_status/tools/clear_transients", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/system-status.mdx b/docs/apis/rest-api/v3/system-status.mdx
new file mode 100644
index 00000000000..31d0e0f704b
--- /dev/null
+++ b/docs/apis/rest-api/v3/system-status.mdx
@@ -0,0 +1,311 @@
+---
+sidebar_position: 28
+sidebar_label: 'System Status'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# System status
+
+The system status API allows you to view all system status items.
+
+## System status properties
+
+| Attribute | Type | Description |
+| ---------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------ |
+| `environment` | object | Environment. See [System status - Environment properties](#system-status---environment-properties) `READ-ONLY` |
+| `database` | object | Database. See [System status - Database properties](#system-status---database-properties) `READ-ONLY` |
+| `active_plugins` | array | Active plugins. `READ-ONLY` |
+| `theme` | object | Theme. See [System status - Theme properties](#system-status---theme-properties) `READ-ONLY` |
+| `settings` | object | Settings. See [System status - Settings properties](#system-status---settings-properties) `READ-ONLY` |
+| `security` | object | Security. See [System status - Security properties](#system-status---security-properties) `READ-ONLY` |
+| `pages` | array | WooCommerce pages. `READ-ONLY` |
+
+### System status - Environment properties
+
+| Attribute | Type | Description |
+| --------------------------- | ------- | -------------------------------------------------------------------------- |
+| `home_url` | string | Home URL. `READ-ONLY` |
+| `site_url` | string | Site URL. `READ-ONLY` |
+| `version` | string | WooCommerce version. `READ-ONLY` |
+| `log_directory` | string | Log directory. `READ-ONLY` |
+| `log_directory_writable` | boolean | Is log directory writable? `READ-ONLY` |
+| `wp_version` | string | WordPress version. `READ-ONLY` |
+| `wp_multisite` | boolean | Is WordPress multisite? `READ-ONLY` |
+| `wp_memory_limit` | integer | WordPress memory limit. `READ-ONLY` |
+| `wp_debug_mode` | boolean | Is WordPress debug mode active? `READ-ONLY` |
+| `wp_cron` | boolean | Are WordPress cron jobs enabled? `READ-ONLY` |
+| `wp_environment_type` | string | WordPress environment type. `READ-ONLY` |
+| `language` | string | WordPress language. `READ-ONLY` |
+| `server_info` | string | Server info. `READ-ONLY` |
+| `php_version` | string | PHP version. `READ-ONLY` |
+| `php_post_max_size` | integer | PHP post max size. `READ-ONLY` |
+| `php_max_execution_time` | integer | PHP max execution time. `READ-ONLY` |
+| `php_max_input_vars` | integer | PHP max input vars. `READ-ONLY` |
+| `curl_version` | string | cURL version. `READ-ONLY` |
+| `suhosin_installed` | boolean | Is SUHOSIN installed? `READ-ONLY` |
+| `max_upload_size` | integer | Max upload size. `READ-ONLY` |
+| `mysql_version` | string | MySQL version. `READ-ONLY` |
+| `default_timezone` | string | Default timezone. `READ-ONLY` |
+| `fsockopen_or_curl_enabled` | boolean | Is fsockopen/cURL enabled? `READ-ONLY` |
+| `soapclient_enabled` | boolean | Is SoapClient class enabled? `READ-ONLY` |
+| `domdocument_enabled` | boolean | Is DomDocument class enabled? `READ-ONLY` |
+| `gzip_enabled` | boolean | Is GZip enabled? `READ-ONLY` |
+| `mbstring_enabled` | boolean | Is mbstring enabled? `READ-ONLY` |
+| `remote_post_successful` | boolean | Remote POST successful? `READ-ONLY` |
+| `remote_post_response` | string | Remote POST response. `READ-ONLY` |
+| `remote_get_successful` | boolean | Remote GET successful? `READ-ONLY` |
+| `remote_get_response` | string | Remote GET response. `READ-ONLY` |
+
+### System status - Database properties
+
+| Attribute | Type | Description |
+| ------------------------ | ------ | ----------------------------------------------------------------- |
+| `wc_database_version` | string | WC database version. `READ-ONLY` |
+| `database_prefix` | string | Database prefix. `READ-ONLY` |
+| `maxmind_geoip_database` | string | MaxMind GeoIP database. `READ-ONLY` |
+| `database_tables` | array | Database tables. `READ-ONLY` |
+
+### System status - Theme properties
+
+| Attribute | Type | Description |
+| ------------------------- | ------- | ------------------------------------------------------------------------------------- |
+| `name` | string | Theme name. `READ-ONLY` |
+| `version` | string | Theme version. `READ-ONLY` |
+| `version_latest` | string | Latest version of theme. `READ-ONLY` |
+| `author_url` | string | Theme author URL. `READ-ONLY` |
+| `is_child_theme` | boolean | Is this theme a child theme? `READ-ONLY` |
+| `has_woocommerce_support` | boolean | Does the theme declare WooCommerce support? `READ-ONLY` |
+| `has_woocommerce_file` | boolean | Does the theme have a woocommerce.php file? `READ-ONLY` |
+| `has_outdated_templates` | boolean | Does this theme have outdated templates? `READ-ONLY` |
+| `overrides` | array | Template overrides. `READ-ONLY` |
+| `parent_name` | string | Parent theme name. `READ-ONLY` |
+| `parent_version` | string | Parent theme version. `READ-ONLY` |
+| `parent_author_url` | string | Parent theme author URL. `READ-ONLY` |
+
+### System status - Settings properties
+
+| Attribute | Type | Description |
+| --------------------- | ------- | ------------------------------------------------------------------------------------ |
+| `api_enabled` | boolean | REST API enabled? `READ-ONLY` |
+| `force_ssl` | boolean | SSL forced? `READ-ONLY` |
+| `currency` | string | Currency. `READ-ONLY` |
+| `currency_symbol` | string | Currency symbol. `READ-ONLY` |
+| `currency_position` | string | Currency position. `READ-ONLY` |
+| `thousand_separator` | string | Thousand separator. `READ-ONLY` |
+| `decimal_separator` | string | Decimal separator. `READ-ONLY` |
+| `number_of_decimals` | integer | Number of decimals. `READ-ONLY` |
+| `geolocation_enabled` | boolean | Geolocation enabled? `READ-ONLY` |
+| `taxonomies` | array | Taxonomy terms for product/order statuses. `READ-ONLY` |
+
+### System status - Security properties
+
+| Attribute | Type | Description |
+| ------------------- | ------- | --------------------------------------------------------------------------------- |
+| `secure_connection` | boolean | Is the connection to your store secure? `READ-ONLY` |
+| `hide_errors` | boolean | Hide errors from visitors? `READ-ONLY` |
+
+## List all system status items
+
+This API helps you to view all the system status items.
+
+```http
+GET /wp-json/wc/v3/system_status
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/system_status \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'system_status' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('system_status')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("system_status").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("system_status").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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,
+ "wp_environment_type": "production",
+ "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": "$",
+ "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
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/tax-classes.mdx b/docs/apis/rest-api/v3/tax-classes.mdx
new file mode 100644
index 00000000000..4534b49630c
--- /dev/null
+++ b/docs/apis/rest-api/v3/tax-classes.mdx
@@ -0,0 +1,286 @@
+---
+sidebar_position: 19
+sidebar_label: 'Tax Classes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# Tax classes
+
+The tax classes API allows you to create, view, and delete individual tax classes.
+
+## Tax class properties
+
+| Attribute | Type | Description |
+| --------- | ------ | ----------------------------------------------------------------------------- |
+| `slug` | string | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | Tax class name. `REQUIRED` |
+
+## Create a tax class
+
+This API helps you to create a new tax class.
+
+```http
+POST /wp-json/wc/v3/taxes/classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: 'Zero Rate',
+};
+
+WooCommerce.post( 'taxes/classes', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Zero Rate'
+];
+
+print_r($woocommerce->post('taxes/classes', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Zero Rate"
+}
+
+print(wcapi.post("taxes/classes", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Zero Rate"
+}
+
+woocommerce.post("taxes/classes", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "slug": "zero-rate",
+ "name": "Zero Rate",
+ "_links": {
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/taxes/classes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all tax classes
+
+This API helps you to view all tax classes.
+
+```http
+GET /wp-json/wc/v3/taxes/classes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/taxes/classes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'taxes/classes' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes/classes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes/classes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes/classes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a tax class
+
+This API helps you delete a tax class.
+
+:::warning
+This also will delete all tax rates from the selected class.
+:::
+
+```http
+DELETE /wp-json/wc/v3/taxes/classes/<slug>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/taxes/classes/zero-rate?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'taxes/classes/zero-rate', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('taxes/classes/zero-rate', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("taxes/classes/zero-rate", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("taxes/classes/zero-rate", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "slug": "zero-rate",
+ "name": "Zero Rate",
+ "_links": {
+ "collection": [
+ {
+ "href": "https://example.com/wp-json/wc/v3/taxes/classes"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | --------------------------------------------------------------------- |
+| `force` | string | Required to be `true`, since this resource does not support trashing. |
diff --git a/docs/apis/rest-api/v3/taxes.mdx b/docs/apis/rest-api/v3/taxes.mdx
new file mode 100644
index 00000000000..7fae2cc8d1a
--- /dev/null
+++ b/docs/apis/rest-api/v3/taxes.mdx
@@ -0,0 +1,4174 @@
+---
+sidebar_position: 18
+sidebar_label: 'Taxes'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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
+
+| Attribute | Type | Description |
+| ----------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `country` | string | Country ISO 3166 code. See [ISO 3166 Codes (Countries)](http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html) for more details |
+| `state` | string | State code. |
+| `postcode` | string | Postcode/ZIP, it doesn't support multiple values. Deprecated as of WooCommerce 5.3, `postcodes` should be used instead. |
+| `city` | string | City name, it doesn't support multiple values. Deprecated as of WooCommerce 5.3, `postcodes` should be used instead. |
+| `postcodes` | string[] | Postcodes/ZIPs. Introduced in WooCommerce 5.3. |
+| `cities` | string[] | City names. Introduced in WooCommerce 5.3. |
+| `rate` | string | Tax rate. |
+| `name` | string | Tax rate name. |
+| `priority` | integer | Tax 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`. |
+| `compound` | boolean | Whether or not this is a compound tax rate. Compound rates are applied on top of other tax rates. Default is `false`. |
+| `shipping` | boolean | Whether or not this tax rate also gets applied to shipping. Default is `true`. |
+| `order` | integer | Indicates the order that will appear in queries. |
+| `class` | string | Tax class. Default is `standard`. |
+
+## Create a tax rate
+
+This API helps you to create a new tax rate.
+
+```http
+POST /wp-json/wc/v3/taxes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a tax rate
+
+This API lets you retrieve and view a specific tax rate by ID.
+
+```http
+GET /wp-json/wc/v3/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/taxes/72 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'taxes/72' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes/72')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes/72").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes/72").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all tax rates
+
+This API helps you to view all the tax rates.
+
+```http
+GET /wp-json/wc/v3/taxes
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/taxes \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'taxes' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('taxes')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("taxes").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("taxes").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| ---------- | ------- | --------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. |
+| `page` | integer | Current page of the collection. |
+| `per_page` | integer | Maximum number of items to be returned in result set. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Default is `asc`. Options: `asc` and `desc`. |
+| `orderby` | string | Sort collection by object attribute. Default is `order`. Options: `id`, `order` and `priority`. |
+| `class` | string | Retrieve only tax rates of this Tax class. |
+
+## Update a tax rate
+
+This API lets you make changes to a tax rate.
+
+```http
+PUT /wp-json/wc/v3/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ name: 'US Tax',
+};
+
+WooCommerce.put( 'taxes/72', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'US Tax'
+];
+
+print_r($woocommerce->put('taxes/72', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "US Tax"
+}
+
+print(wcapi.put("taxes/72", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "US Tax"
+}
+
+woocommerce.put("taxes/72", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a tax rate
+
+This API helps you delete a tax rate.
+
+```http
+DELETE /wp-json/wc/v3/taxes/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/taxes/72?force=true \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'taxes/72', {
+ force: true,
+} )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('taxes/72', ['force' => true])); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("taxes/72", params={"force": True}).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("taxes/72", force: true).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | ------------------------------------------------------------- |
+| `force` | string | Required 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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/taxes/batch
+```
+
+> Example batch creating all US taxes:
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ }
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/rest-api/v3/webhooks.mdx b/docs/apis/rest-api/v3/webhooks.mdx
new file mode 100644
index 00000000000..550b92d8c65
--- /dev/null
+++ b/docs/apis/rest-api/v3/webhooks.mdx
@@ -0,0 +1,887 @@
+---
+sidebar_position: 20
+sidebar_label: 'Webhooks'
+---
+
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+# 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 using the WooCommerce logging system. Each delivery log includes:
+
+- Request duration.
+- Request URL, method, headers, and body.
+- Response Code, message, headers, and body.
+
+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](https://docs.woocommerce.com/document/webhooks/) for more details.
+
+## Webhook properties
+
+| Attribute | Type | Description |
+| ------------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Unique identifier for the resource. `READ-ONLY` |
+| `name` | string | A friendly name for the webhook. |
+| `status` | string | Webhook status. Options: `active`, `paused` and `disabled`. Default is `active`. |
+| `topic` | string | Webhook topic. `MANDATORY` |
+| `resource` | string | Webhook resource. `READ-ONLY` |
+| `event` | string | Webhook event. `READ-ONLY` |
+| `hooks` | array | WooCommerce action names associated with the webhook. `READ-ONLY` |
+| `delivery_url` | string | The URL where the webhook payload is delivered. `READ-ONLY` `MANDATORY` |
+| `secret` | string | 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. `WRITE-ONLY` `MANDATORY` |
+| `date_created` | date-time | The date the webhook was created, in the site's timezone. `READ-ONLY` |
+| `date_created_gmt` | date-time | The date the webhook was created, as GMT. `READ-ONLY` |
+| `date_modified` | date-time | The date the webhook was last modified, in the site's timezone. `READ-ONLY` |
+| `date_modified_gmt` | date-time | The date the webhook was last modified, as GMT. `READ-ONLY` |
+
+## Create a webhook
+
+This API helps you to create a new webhook.
+
+```http
+POST /wp-json/wc/v3/webhooks
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'name' => 'Order updated',
+ 'topic' => 'order.updated',
+ 'delivery_url' => 'http://requestb.in/1g0sxmo1'
+];
+
+print_r($woocommerce->post('webhooks', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "name": "Order updated",
+ "topic": "order.updated",
+ "delivery_url": "http://requestb.in/1g0sxmo1"
+}
+
+print(wcapi.post("webhooks", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ name: "Order updated",
+ topic: "order.updated",
+ delivery_url: "http://requestb.in/1g0sxmo1"
+}
+
+woocommerce.post("webhooks", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Retrieve a webhook
+
+This API lets you retrieve and view a specific webhook.
+
+```http
+GET /wp-json/wc/v3/webhooks/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/webhooks/142 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'webhooks/142' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks/142')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks/142").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks/142").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## List all webhooks
+
+This API helps you to view all the webhooks.
+
+```http
+GET /wp-json/wc/v3/webhooks
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl https://example.com/wp-json/wc/v3/webhooks \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.get( 'webhooks' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->get('webhooks')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.get("webhooks").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.get("webhooks").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+[
+ {
+ "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"
+ }
+ ]
+ }
+ }
+]
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
+| `context` | string | Scope under which the request is made; determines fields present in response. Options: `view` and `edit`. Default is `view`. |
+| `page` | integer | Current page of the collection. Default is `1`. |
+| `per_page` | integer | Maximum number of items to be returned in result set. Default is `10`. |
+| `search` | string | Limit results to those matching a string. |
+| `after` | string | Limit response to resources published after a given ISO8601 compliant date. |
+| `before` | string | Limit response to resources published before a given ISO8601 compliant date. |
+| `dates_are_gmt` | boolean | Whether to interpret dates as GMT dates when limiting response by published date. |
+| `exclude` | array | Ensure result set excludes specific IDs. |
+| `include` | array | Limit result set to specific ids. |
+| `offset` | integer | Offset the result set by a specific number of items. |
+| `order` | string | Order sort attribute ascending or descending. Options: `asc` and `desc`. Default is `desc`. |
+| `orderby` | string | Sort collection by object attribute. Options: `date`, `id`, `include`, `title` and `slug`. Default is `date`. |
+| `status` | string | Limit 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
+PUT /wp-json/wc/v3/webhooks/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X PUT https://example.com/wp-json/wc/v3/webhooks/142 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "status": "paused"
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+const data = {
+ status: 'paused',
+};
+
+WooCommerce.put( 'webhooks/142', data )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php
+$data = [
+ 'status' => 'paused'
+];
+
+print_r($woocommerce->put('webhooks/142', $data));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+data = {
+ "status": "paused"
+}
+
+print(wcapi.put("webhooks/142", data).json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+data = {
+ status: "paused"
+}
+
+woocommerce.put("webhooks/142", data).parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+## Delete a webhook
+
+This API helps you delete a webhook.
+
+```http
+DELETE /wp-json/wc/v3/webhooks/<id>
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+curl -X DELETE https://example.com/wp-json/wc/v3/webhooks/142 \
+ -u consumer_key:consumer_secret
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+WooCommerce.delete( 'webhooks/142' )
+ .then( ( response ) => {
+ console.log( response.data );
+ } )
+ .catch( ( error ) => {
+ console.log( error.response.data );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?php print_r($woocommerce->delete('webhooks/142')); ?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+print(wcapi.delete("webhooks/142").json())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+woocommerce.delete("webhooks/142").parsed_response
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+}
+```
+
+ </TabItem>
+</Tabs>
+
+#### Available parameters
+
+| Parameter | Type | Description |
+| --------- | ------ | -------------------------------------------------------------------------- |
+| `force` | string | Use `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.
+
+:::note
+Note: By default it's limited to up to 100 objects to be created, updated or
+ deleted.
+:::
+
+```http
+POST /wp-json/wc/v3/webhooks/batch
+```
+
+<Tabs>
+ <TabItem value="curl" label="cURL">
+
+```shell
+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
+ ]
+}'
+```
+
+ </TabItem>
+ <TabItem value="js" label="JavaScript">
+
+```javascript
+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 );
+ } );
+```
+
+ </TabItem>
+ <TabItem value="php" label="PHP">
+
+```php
+<?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));
+?>
+```
+
+ </TabItem>
+ <TabItem value="python" label="Python">
+
+```python
+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())
+```
+
+ </TabItem>
+ <TabItem value="ruby" label="Ruby">
+
+```ruby
+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
+```
+
+ </TabItem>
+ <TabItem value="response" label="JSON Response">
+
+```json
+{
+ "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"
+ }
+ ]
+ }
+ }
+ ]
+}
+```
+
+ </TabItem>
+</Tabs>
diff --git a/docs/apis/store-api/README.md b/docs/apis/store-api/README.md
index 3b508b99b9b..efa88211401 100644
--- a/docs/apis/store-api/README.md
+++ b/docs/apis/store-api/README.md
@@ -29,7 +29,7 @@ Possible uses of the Store API include:
* All API responses return JSON-formatted data.
* Data returned from the API is reflective of the current user (customer). Customer sessions in WooCommerce are cookie-based.
* Store API cannot be used to look up other customers and orders by ID; only data belonging to the current user.
-* Likewise, Store API cannot be used to write store data e.g. settings. For more extensive access, use the authenticated [WC REST API.](https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction)
+* Likewise, Store API cannot be used to write store data e.g. settings. For more extensive access, use the authenticated [WC REST API.](/docs/apis/rest-api/)
* Endpoints that do allow writes, for example, updating the current customer address, require a [nonce-token](https://developer.wordpress.org/plugins/security/nonces/).
* Store API is render-target agnostic and should not make assumptions about where content will be displayed. For example, returning HTML would be discouraged unless the data type itself is HTML.
@@ -50,33 +50,33 @@ The API uses JSON to serialize data. You don’t need to specify `.json` at the
Available resources in the Store API are listed below, with links to more detailed documentation.
-| Resource | Methods | Endpoints |
-| :----------------------------------------------------------- | :----------------------------- | --------------------------------------------------------------------------------------------- |
-| [`Cart`](/docs/apis/store-api/resources-endpoints/cart) | `GET` | [`/wc/store/v1/cart`](/docs/apis/store-api/resources-endpoints/cart#get-cart) |
-| | `POST` | [`/wc/store/v1/cart/add-item`](/docs/apis/store-api/resources-endpoints/cart#add-item) |
-| | `POST` | [`/wc/store/v1/cart/remove-item`](/docs/apis/store-api/resources-endpoints/cart#remove-item) |
-| | `POST` | [`/wc/store/v1/cart/update-item`](/docs/apis/store-api/resources-endpoints/cart#update-item) |
-| | `POST` | [`/wc/store/v1/cart/apply-coupon`](/docs/apis/store-api/resources-endpoints/cart#apply-coupon) |
-| | `POST` | [`/wc/store/v1/cart/remove-coupon`](/docs/apis/store-api/resources-endpoints/cart#remove-coupon) |
-| | `POST` | [`/wc/store/v1/cart/update-customer`](/docs/apis/store-api/resources-endpoints/cart#update-customer) |
-| | `POST` | [`/wc/store/v1/cart/select-shipping-rate`](/docs/apis/store-api/resources-endpoints/cart#select-shipping-rate) |
-| [`Cart Items`](/docs/apis/store-api/resources-endpoints/cart-items) | `GET`, `POST`, `DELETE` | [`/wc/store/v1/cart/items`](/docs/apis/store-api/resources-endpoints/cart-items#list-cart-items) |
-| | `GET`, `POST`, `PUT`, `DELETE` | [`/wc/store/v1/cart/items/:key`](/docs/apis/store-api/resources-endpoints/cart-items#single-cart-item) |
-| [`Cart Coupons`](/docs/apis/store-api/resources-endpoints/cart-coupons) | `GET`, `POST`, `DELETE` | [`/wc/store/v1/cart/coupons`](/docs/apis/store-api/resources-endpoints/cart-coupons#list-cart-coupons) |
-| | `GET`, `DELETE` | [`/wc/store/v1/cart/coupon/:code`](/docs/apis/store-api/resources-endpoints/cart-coupons#single-cart-coupon) |
-| [`Checkout`](/docs/apis/store-api/resources-endpoints/checkout) | `GET`, `POST`, `PUT` | [`/wc/store/v1/checkout`](/docs/apis/store-api/resources-endpoints/checkout) |
-| [`Checkout order`](/docs/apis/store-api/resources-endpoints/checkout-order) | `POST` | [`/wc/store/v1/checkout/:id`](/docs/apis/store-api/resources-endpoints/checkout-order) |
-| [`Order`](/docs/apis/store-api/resources-endpoints/order) | `GET` | [`/wc/store/v1/order/:id`](/docs/apis/store-api/resources-endpoints/order) |
-| [`Products`](/docs/apis/store-api/resources-endpoints/products) | `GET` | [`/wc/store/v1/products`](/docs/apis/store-api/resources-endpoints/products#list-products) |
-| | `GET` | [`/wc/store/v1/products/:id`](/docs/apis/store-api/resources-endpoints/products#single-product-by-id) |
-| [`Product Collection Data`](/docs/apis/store-api/resources-endpoints/product-collection-data) | `GET` | [`/wc/store/v1/products/collection-data`](/docs/apis/store-api/resources-endpoints/product-collection-data) |
-| [`Product Attributes`](/docs/apis/store-api/resources-endpoints/product-attributes) | `GET` | [`/wc/store/v1/products/attributes`](/docs/apis/store-api/resources-endpoints/product-attributes#list-product-attributes) |
-| | `GET` | [`/wc/store/v1/products/attributes/:id`](/docs/apis/store-api/resources-endpoints/product-attributes#single-product-attribute) |
-| [`Product Attribute Terms`](/docs/apis/store-api/resources-endpoints/product-attribute-terms) | `GET` | [`/wc/store/v1/products/attributes/:id/terms`](/docs/apis/store-api/resources-endpoints/product-attribute-terms) |
-| [`Product Categories`](/docs/apis/store-api/resources-endpoints/product-categories) | `GET` | [`/wc/store/v1/products/categories`](/docs/apis/store-api/resources-endpoints/product-categories) |
-| [`Product Brands`](/docs/apis/store-api/resources-endpoints/product-brands) | `GET` | [`/wc/store/v1/products/brands`](/docs/apis/store-api/resources-endpoints/product-brands) |
-| [`Product Reviews`](/docs/apis/store-api/resources-endpoints/product-reviews) | `GET` | [`/wc/store/v1/products/reviews`](/docs/apis/store-api/resources-endpoints/product-reviews) |
-| [`Product Tags`](/docs/apis/store-api/resources-endpoints/product-tags) | `GET` | [`/wc/store/v1/products/tags`](/docs/apis/store-api/resources-endpoints/product-tags) |
+| Resource | Methods | Endpoints |
+| --- | --- | --- |
+| [`Cart`](/docs/apis/store-api/resources-endpoints/cart) | `GET` | [`/wc/store/v1/cart`](/docs/apis/store-api/resources-endpoints/cart#get-cart) |
+| | `POST` | [`/wc/store/v1/cart/add-item`](/docs/apis/store-api/resources-endpoints/cart#add-item) |
+| | `POST` | [`/wc/store/v1/cart/remove-item`](/docs/apis/store-api/resources-endpoints/cart#remove-item) |
+| | `POST` | [`/wc/store/v1/cart/update-item`](/docs/apis/store-api/resources-endpoints/cart#update-item) |
+| | `POST` | [`/wc/store/v1/cart/apply-coupon`](/docs/apis/store-api/resources-endpoints/cart#apply-coupon) |
+| | `POST` | [`/wc/store/v1/cart/remove-coupon`](/docs/apis/store-api/resources-endpoints/cart#remove-coupon) |
+| | `POST` | [`/wc/store/v1/cart/update-customer`](/docs/apis/store-api/resources-endpoints/cart#update-customer) |
+| | `POST` | [`/wc/store/v1/cart/select-shipping-rate`](/docs/apis/store-api/resources-endpoints/cart#select-shipping-rate) |
+| [`Cart Items`](/docs/apis/store-api/resources-endpoints/cart-items) | `GET`, `POST`, `DELETE` | [`/wc/store/v1/cart/items`](/docs/apis/store-api/resources-endpoints/cart-items#list-cart-items) |
+| | `GET`, `POST`, `PUT`, `DELETE` | [`/wc/store/v1/cart/items/:key`](/docs/apis/store-api/resources-endpoints/cart-items#single-cart-item) |
+| [`Cart Coupons`](/docs/apis/store-api/resources-endpoints/cart-coupons) | `GET`, `POST`, `DELETE` | [`/wc/store/v1/cart/coupons`](/docs/apis/store-api/resources-endpoints/cart-coupons#list-cart-coupons) |
+| | `GET`, `DELETE` | [`/wc/store/v1/cart/coupon/:code`](/docs/apis/store-api/resources-endpoints/cart-coupons#single-cart-coupon) |
+| [`Checkout`](/docs/apis/store-api/resources-endpoints/checkout) | `GET`, `POST`, `PUT` | [`/wc/store/v1/checkout`](/docs/apis/store-api/resources-endpoints/checkout) |
+| [`Checkout order`](/docs/apis/store-api/resources-endpoints/checkout-order) | `POST` | [`/wc/store/v1/checkout/:id`](/docs/apis/store-api/resources-endpoints/checkout-order) |
+| [`Order`](/docs/apis/store-api/resources-endpoints/order) | `GET` | [`/wc/store/v1/order/:id`](/docs/apis/store-api/resources-endpoints/order) |
+| [`Products`](/docs/apis/store-api/resources-endpoints/products) | `GET` | [`/wc/store/v1/products`](/docs/apis/store-api/resources-endpoints/products#list-products) |
+| | `GET` | [`/wc/store/v1/products/:id`](/docs/apis/store-api/resources-endpoints/products#single-product-by-id) |
+| [`Product Collection Data`](/docs/apis/store-api/resources-endpoints/product-collection-data) | `GET` | [`/wc/store/v1/products/collection-data`](/docs/apis/store-api/resources-endpoints/product-collection-data) |
+| [`Product Attributes`](/docs/apis/store-api/resources-endpoints/product-attributes) | `GET` | [`/wc/store/v1/products/attributes`](/docs/apis/store-api/resources-endpoints/product-attributes#list-product-attributes) |
+| | `GET` | [`/wc/store/v1/products/attributes/:id`](/docs/apis/store-api/resources-endpoints/product-attributes#single-product-attribute) |
+| [`Product Attribute Terms`](/docs/apis/store-api/resources-endpoints/product-attribute-terms) | `GET` | [`/wc/store/v1/products/attributes/:id/terms`](/docs/apis/store-api/resources-endpoints/product-attribute-terms) |
+| [`Product Categories`](/docs/apis/store-api/resources-endpoints/product-categories) | `GET` | [`/wc/store/v1/products/categories`](/docs/apis/store-api/resources-endpoints/product-categories) |
+| [`Product Brands`](/docs/apis/store-api/resources-endpoints/product-brands) | `GET` | [`/wc/store/v1/products/brands`](/docs/apis/store-api/resources-endpoints/product-brands) |
+| [`Product Reviews`](/docs/apis/store-api/resources-endpoints/product-reviews) | `GET` | [`/wc/store/v1/products/reviews`](/docs/apis/store-api/resources-endpoints/product-reviews) |
+| [`Product Tags`](/docs/apis/store-api/resources-endpoints/product-tags) | `GET` | [`/wc/store/v1/products/tags`](/docs/apis/store-api/resources-endpoints/product-tags) |
## Pagination
@@ -157,7 +157,7 @@ If new schema is required, and any of the following statements are true, choose
* The data is related to a resource, but not technically part of it
* The data is difficult to query (performance wise) or has a very narrow or niche use-case
-If the data is sensitive (for example, a core setting that should be private), or not related to the current user (for example, looking up an order by order ID), [choose to use the authenticated WC REST API](https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction).
+If the data is sensitive (for example, a core setting that should be private), or not related to the current user (for example, looking up an order by order ID), [choose to use the authenticated WC REST API](/docs/apis/rest-api/).
If you're looking to add _new routes and endpoints_, rather than extending the Store API _schema_, extending the Store API is not necessary. You can instead utilize core WordPress functionality to create new routes, choosing to use the same pattern of Store API if you wish. See:
diff --git a/docs/apis/store-api/guiding-principles.md b/docs/apis/store-api/guiding-principles.md
index 3323b318b3c..781528b3769 100644
--- a/docs/apis/store-api/guiding-principles.md
+++ b/docs/apis/store-api/guiding-principles.md
@@ -80,7 +80,7 @@ An example would be the `wc/store/v1/cart/add-item` endpoint which accepts a qua
Resources, including customer and order data, should reflect only the current session. Do not return data for other customers as this would be a breach of privacy and security issue.
-Store data such as settings (for example, store currency) is permitted in responses, but _private or sensitive data_ must be avoided. To allow more extensive access to data, you must use the authenticated [WC REST API](https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction).
+Store data such as settings (for example, store currency) is permitted in responses, but _private or sensitive data_ must be avoided. To allow more extensive access to data, you must use the authenticated [WC REST API](/docs/apis/rest-api/).
Data returned from the API should not be [escaped](https://developer.wordpress.org/themes/theme-security/data-sanitization-escaping/) (this is left to the client rendering it), but it should be sanitized. For example, HTML should be run through [`wp_kses_post`](https://developer.wordpress.org/reference/functions/wp_kses_post/).
diff --git a/docs/features/mcp/README.md b/docs/features/mcp/README.md
index bbf7b1792c9..2bec86721bc 100644
--- a/docs/features/mcp/README.md
+++ b/docs/features/mcp/README.md
@@ -341,4 +341,4 @@ Check **WooCommerce → Status → Logs** for entries with source `woocommerce-m
- [WordPress MCP Adapter Repository](https://github.com/WordPress/mcp-adapter)
- [WooCommerce MCP Demo Plugin](https://github.com/woocommerce/wc-mcp-ability)
- [Model Context Protocol Specification](https://modelcontextprotocol.io/)
-- [WooCommerce REST API Documentation](https://woocommerce.github.io/woocommerce-rest-api-docs/)
+- [WooCommerce REST API Documentation](/docs/apis/rest-api/)
diff --git a/docs/getting-started/ai.md b/docs/getting-started/ai.md
index b11454ba400..f109f8a6331 100644
--- a/docs/getting-started/ai.md
+++ b/docs/getting-started/ai.md
@@ -23,7 +23,7 @@ To feed the WooCommerce Developer Documentation into your LLM or AI-assisted IDE
If you are using an IDE like Cursor or Windsurf, we recommend adding these links as custom documentation so that you can reference them as needed.
-**Note** that these do not include the contents of the [WC REST API documentation](https://woocommerce.github.io/woocommerce-rest-api-docs/#introduction) or the [WooCommerce Code Reference](https://woocommerce.github.io/code-reference/).
+**Note** that these do not include the contents of the [WooCommerce Code Reference](https://woocommerce.github.io/code-reference/).
### Serve as Markdown