diff --git a/source/includes/v3/_authentication-endpoint.md b/source/includes/v3/_authentication-endpoint.md index ff9dd516..3ebf898d 100644 --- a/source/includes/v3/_authentication-endpoint.md +++ b/source/includes/v3/_authentication-endpoint.md @@ -1,47 +1,111 @@ # Authentication Endpoint # -Staring in WooCommerce 2.4 we introduced our Authentication Endpoint, where any app can easy allow users to generate API keys and send back automatically to the app. - -This makes integration with WooCommerce API much simpler, since the user only needs to access a URL, click in the "accept" button and will be redirected back to the app and the API keys are sent back in a POST request. +Starting in WooCommerce 2.4 we introduced an Authentication Endpoint, This can be used by any app to allow users to generate API keys. This makes integration with WooCommerce API simpler because the user only needs to access a URL and click "accept". After being redirected back to the app, the API keys will be sent in a POST request. The following image illustrates how it's done:  ## URL parameters ## -| Paramenter | Type | Description | +| 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 that will be used for receive the user back in your app mandatory | -| `callback_url` | string | URL that will receive the generated API key. Important to note that this URL should be over **SSL** 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 Authentication Endpoint URL ## -You must use the `/wc-auth/v1/authorize` endpoint and pass the above parameters as query string. +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: -> Example of how do it in PHP: +```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" +``` +```javascript +var querystring = require('querystring'); + +var store_url = 'http://example.com'; +var endpoint = '/wc-auth/v1/authorize'; +var params = { + app_name: 'My App Name', + scope: 'read_write', + user_id: 123, + return_url: 'http://app.com/return-page', + callback_url: 'https://app.com/callback-endpoint' +}; +var query_string = querystring.stringify(params).replace(/%20/g, '+'); + +console.log(store_url + endpoint + '?' + query_string); ``` + +```php + 'My App Name', - 'scope' => 'read_write', - 'user_id' => 123, - 'return_url' => 'http://app.com/return-page', - 'callback_url' => 'https://app.com/callback-endpoint' -); -echo $store_url . $endpoint . '?' . http_build_query( $params ); +$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; +?> +``` + +```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)) +``` + +```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}" ``` -> Example the JSON posted with the API Keys +> Example of JSON posted with the API Keys ``` { @@ -53,14 +117,14 @@ echo $store_url . $endpoint . '?' . http_build_query( $params ); } ``` -Example of the screen that the user will access: +Example of the screen that the user will see:  ## Notes and Tips ## -- While redirecting the user using `return_url` 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 (`return_url`) to your app and also to save the API Keys in your `callback_url`. -- This 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');`. +- While redirecting the user using `return_url`, you are also sent `success` and `user_id` parameters as query strings. +- `success` sends `0` if the user denied, or `1` if authenticated successfully. +- Use `user_id` to identify the user when redirected back to the (`return_url`) and also remember to save the API Keys when your `callback_url` is posted to after auth. +- The auth endpoint will send the API Keys in JSON format to the `callback_url`, so it's important to remember that some languages such as PHP will not display it inside the `$_POST` global variable, in PHP you can access it using `$HTTP_RAW_POST_DATA` (for old PHP versions) or `file_get_contents('php://input');`. - This authentication endpoint is used only to make easy integration with WooCommerce REST API. THIS NOT INTENDED TO BE USED AS A LOGIN ENDPOINT FOR CUSTOMERS! diff --git a/source/includes/v3/_coupons.md b/source/includes/v3/_coupons.md index 90ed849f..e642a5e0 100644 --- a/source/includes/v3/_coupons.md +++ b/source/includes/v3/_coupons.md @@ -1,6 +1,6 @@ # Coupons # -This section lists all API that can be used to create, edit or otherwise manipulate coupons. +This section lists all API endpoints that can be used to create, edit or otherwise manipulate coupons. ## Coupon Properties ## @@ -29,7 +29,7 @@ This section lists all API that can be used to create, edit or otherwise manipul | `customer_emails` | array | Array of email addresses that can use this coupon | | `description` | string | Coupon description | -## Create A Coupon ## +## Create a Coupon ## This API helps you to create a new coupon. @@ -50,7 +50,7 @@ curl -X POST https://example.com/wc-api/v3/coupons \ "coupon": { "code": "new-coupon", "type": "percent", - "amount": "10", + "amount": 10, "individual_use": true, "product_ids": [], "exclude_product_ids": [], @@ -75,7 +75,7 @@ var data = { coupon: { code: 'new-coupon', type: 'percent', - amount: '10', + amount: 10, individual_use: true, product_ids: [], exclude_product_ids: [], @@ -99,12 +99,41 @@ WooCommerce.post('coupons', data, function(err, data, res) { }); ``` +```php + [ + 'code' => 'new-coupon', + 'type' => 'percent', + 'amount' => 10, + 'individual_use' => true, + 'product_ids' => [], + 'exclude_product_ids' => [], + 'usage_limit' => '', + 'usage_limit_per_user' => '', + 'limit_usage_to_x_items' => '', + 'expiry_date' => '', + 'enable_free_shipping' => false, + 'product_category_ids' => [], + 'exclude_product_category_ids' => [], + 'exclude_sale_items' => true, + 'minimum_amount' => '100.00', + 'maximum_amount' => '0.00', + 'customer_emails' => [], + 'description' => '' + ] +]; + +print_r($woocommerce->post('coupons', $data)); +?> +``` + ```python data = { "coupon": { "code": "new-coupon", "type": "percent", - "amount": "10", + "amount": 10, "individual_use": True, "product_ids": [], "exclude_product_ids": [], @@ -131,7 +160,7 @@ data = { coupon: { code: "new-coupon", type: "percent", - amount: "10", + amount: 10, individual_use: true, product_ids: [], exclude_product_ids: [], @@ -184,7 +213,7 @@ woocommerce.post("coupons", data).parsed_response } ``` -## View A Coupon ## +## View a Coupon ## This API lets you retrieve and view a specific coupon by ID or code. @@ -197,13 +226,6 @@ This API lets you retrieve and view a specific coupon by ID or code. -
": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ]
+ },
+ "/coupons/bulk": {
+ "accepts_data": true,
+ "meta": {
+ "self": "http://example.com/wc-api/v3/coupons/bulk"
+ },
+ "supports": [
+ "POST",
+ "PUT",
+ "PATCH"
+ ]
+ },
+ "/customers": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/customers"
+ },
+ "accepts_data": true
+ },
+ "/customers/count": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/customers/count"
+ }
+ },
+ "/customers/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/customers/email/": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ]
+ },
+ "/customers//orders": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ]
+ },
+ "/customers//downloads": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ]
+ },
+ "/customers/bulk": {
+ "accepts_data": true,
+ "meta": {
+ "self": "http://example.com/wc-api/v3/customers/bulk"
+ },
+ "supports": [
+ "POST",
+ "PUT",
+ "PATCH"
+ ]
+ },
+ "/orders": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/orders"
+ },
+ "accepts_data": true
+ },
+ "/orders/count": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/orders/count"
+ }
+ },
+ "/orders/statuses": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/orders/statuses"
+ }
+ },
+ "/orders/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/orders//notes": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "accepts_data": true
+ },
+ "/orders//notes/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/orders//refunds": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "accepts_data": true
+ },
+ "/orders//refunds/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/orders/bulk": {
+ "accepts_data": true,
+ "meta": {
+ "self": "http://example.com/wc-api/v3/orders/bulk"
+ },
+ "supports": [
+ "POST",
+ "PUT",
+ "PATCH"
+ ]
+ },
+ "/products": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/products"
+ },
+ "accepts_data": true
+ },
+ "/products/count": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/products/count"
+ }
+ },
+ "/products/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/products//reviews": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ]
+ },
+ "/products//orders": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ]
+ },
+ "/products/categories": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
"meta": {
- "currency": "USD",
- "currency_format": "$",
- "currency_position": "left_space",
- "decimal_separator": ",",
- "dimension_unit": "in",
- "generate_password": false,
- "links": {
- "help": "http://woothemes.github.io/woocommerce-rest-api-docs/"
- },
- "permalinks_enabled": true,
- "price_num_decimals": 2,
- "ssl_enabled": true,
- "tax_included": true,
- "thousand_separator": ".",
- "timezone": "America/Los_Angeles",
- "weight_unit": "lbs"
+ "self": "http://example.com/wc-api/v3/products/categories"
},
- "name": "WooCommerce Dev",
- "routes": {
- "/": {
- "meta": {
- "self": "https://example.com/wc-api/v3/"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/coupons": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/coupons"
- },
- "supports": [
- "HEAD",
- "GET",
- "POST"
- ]
- },
- "/coupons/": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE"
- ]
- },
- "/coupons/bulk": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/coupons/bulk"
- },
- "supports": [
- "POST",
- "PUT",
- "PATCH"
- ]
- },
- "/coupons/code/": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/coupons/count": {
- "meta": {
- "self": "https://example.com/wc-api/v3/coupons/count"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/customers": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/customers"
- },
- "supports": [
- "HEAD",
- "GET",
- "POST"
- ]
- },
- "/customers/": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE"
- ]
- },
- "/customers//downloads": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/customers//orders": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/customers/bulk": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/customers/bulk"
- },
- "supports": [
- "POST",
- "PUT",
- "PATCH"
- ]
- },
- "/customers/count": {
- "meta": {
- "self": "https://example.com/wc-api/v3/customers/count"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/customers/email/": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/orders": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/orders"
- },
- "supports": [
- "HEAD",
- "GET",
- "POST"
- ]
- },
- "/orders/": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE"
- ]
- },
- "/orders//notes": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST"
- ]
- },
- "/orders//notes/": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE"
- ]
- },
- "/orders//refunds": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST"
- ]
- },
- "/orders//refunds/": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE"
- ]
- },
- "/orders/bulk": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/orders/bulk"
- },
- "supports": [
- "POST",
- "PUT",
- "PATCH"
- ]
- },
- "/orders/count": {
- "meta": {
- "self": "https://example.com/wc-api/v3/orders/count"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/orders/statuses": {
- "meta": {
- "self": "https://example.com/wc-api/v3/orders/statuses"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/products": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/products"
- },
- "supports": [
- "HEAD",
- "GET",
- "POST"
- ]
- },
- "/products/": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE"
- ]
- },
- "/products//orders": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/products//reviews": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/products/attributes": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/products/attributes"
- },
- "supports": [
- "HEAD",
- "GET",
- "POST"
- ]
- },
- "/products/attributes/": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE"
- ]
- },
- "/products/bulk": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/products/bulk"
- },
- "supports": [
- "POST",
- "PUT",
- "PATCH"
- ]
- },
- "/products/categories": {
- "meta": {
- "self": "https://example.com/wc-api/v3/products/categories"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/products/categories/": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/products/count": {
- "meta": {
- "self": "https://example.com/wc-api/v3/products/count"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/reports": {
- "meta": {
- "self": "https://example.com/wc-api/v3/reports"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/reports/sales": {
- "meta": {
- "self": "https://example.com/wc-api/v3/reports/sales"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/reports/sales/top_sellers": {
- "meta": {
- "self": "https://example.com/wc-api/v3/reports/sales/top_sellers"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/webhooks": {
- "accepts_data": true,
- "meta": {
- "self": "https://example.com/wc-api/v3/webhooks"
- },
- "supports": [
- "HEAD",
- "GET",
- "POST"
- ]
- },
- "/webhooks/": {
- "accepts_data": true,
- "supports": [
- "HEAD",
- "GET",
- "POST",
- "PUT",
- "PATCH",
- "DELETE"
- ]
- },
- "/webhooks//deliveries": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/webhooks//deliveries/": {
- "supports": [
- "HEAD",
- "GET"
- ]
- },
- "/webhooks/count": {
- "meta": {
- "self": "https://example.com/wc-api/v3/webhooks/count"
- },
- "supports": [
- "HEAD",
- "GET"
- ]
- }
+ "accepts_data": true
+ },
+ "/products/categories/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/products/tags": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/products/tags"
+ },
+ "accepts_data": true
+ },
+ "/products/tags/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/products/shipping_classes": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/products/shipping_classes"
+ },
+ "accepts_data": true
+ },
+ "/products/shipping_classes/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/products/attributes": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/products/attributes"
+ },
+ "accepts_data": true
+ },
+ "/products/attributes/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/products/attributes//terms": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "accepts_data": true
+ },
+ "/products/attributes//terms/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/products/bulk": {
+ "accepts_data": true,
+ "meta": {
+ "self": "http://example.com/wc-api/v3/products/bulk"
},
- "wc_version": "2.4.0"
+ "supports": [
+ "POST",
+ "PUT",
+ "PATCH"
+ ]
+ },
+ "/reports": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/reports"
+ }
+ },
+ "/reports/sales": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/reports/sales"
+ }
+ },
+ "/reports/sales/top_sellers": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/reports/sales/top_sellers"
+ }
+ },
+ "/taxes": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/taxes"
+ },
+ "accepts_data": true
+ },
+ "/taxes/count": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/taxes/count"
+ }
+ },
+ "/taxes/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/taxes/classes": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/taxes/classes"
+ },
+ "accepts_data": true
+ },
+ "/taxes/classes/count": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/taxes/classes/count"
+ }
+ },
+ "/taxes/classes/": {
+ "supports": [
+ "DELETE"
+ ]
+ },
+ "/taxes/bulk": {
+ "accepts_data": true,
+ "meta": {
+ "self": "http://example.com/wc-api/v3/taxes/bulk"
+ },
+ "supports": [
+ "POST",
+ "PUT",
+ "PATCH"
+ ]
+ },
+ "/webhooks": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/webhooks"
+ },
+ "accepts_data": true
+ },
+ "/webhooks/count": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ],
+ "meta": {
+ "self": "http://example.com/wc-api/v3/webhooks/count"
+ }
+ },
+ "/webhooks/": {
+ "supports": [
+ "HEAD",
+ "GET",
+ "POST",
+ "PUT",
+ "PATCH",
+ "DELETE"
+ ],
+ "accepts_data": true
+ },
+ "/webhooks//deliveries": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ]
+ },
+ "/webhooks//deliveries/": {
+ "supports": [
+ "HEAD",
+ "GET"
+ ]
+ }
+ },
+ "meta": {
+ "timezone": "America/Los_Angeles",
+ "currency": "USD",
+ "currency_format": "$",
+ "currency_position": "left",
+ "thousand_separator": ".",
+ "decimal_separator": ",",
+ "price_num_decimals": 2,
+ "tax_included": false,
+ "weight_unit": "lbs",
+ "dimension_unit": "in",
+ "ssl_enabled": false,
+ "permalinks_enabled": true,
+ "generate_password": false,
+ "links": {
+ "help": "http://woothemes.github.io/woocommerce-rest-api-docs/"
+ }
}
+ }
}
```
diff --git a/source/includes/v3/_introduction.md b/source/includes/v3/_introduction.md
index 81bbb491..19af2976 100644
--- a/source/includes/v3/_introduction.md
+++ b/source/includes/v3/_introduction.md
@@ -1,30 +1,28 @@
# Introduction #
-Introduced in WooCommerce 2.1, the REST API allows store data to be created, read, updated, and deleted using the JSON format.
+Introduced in WooCommerce 2.1, the REST API allows WooCommerce data to be created, read, updated, and deleted using JSON format.
## Requirements ##
-You must be using WooCommerce 2.1 or newer and the REST API must be enabled under `WooCommerce > Settings`. You must enable pretty permalinks, as default permalinks will not work.
+You must be using WooCommerce 2.1 or newer and the REST API must be enabled under `WooCommerce > Settings`. You must enable pretty permalinks in `Settings > Permalinks` (default permalinks will not work).
## Version ##
-The current API version is `v3` which takes a first-order position in endpoints.
-
-Check the API versions present in every version of WooCommerce:
+The current API version is `v3` which takes a first-order position in endpoints. The following table shows API versions present in each major version of WooCommerce:
| API Version | WooCommerce |
| ----------- | ----------------------------- |
| `v1` | 2.1.x, 2.2.x, 2.3.x and 2.4.x |
| `v2` | 2.2.x, 2.3.x and 2.4.x |
-| `v3` | 2.4.x |
+| `v3` | 2.4.x, 2.5.x |
-The `v1` and `v2` will be removed in future versions.
+The `v1` and `v2` APIs will be removed in future versions.
-### Differences between v1 and v2 versions ###
+### Differences between v1 and v2 ###
* v1 supports XML response format, v2 only supports JSON.
* v1 does not support creating or updating (with the exception of order status) any resources, v2 supports full create/read/update/delete for all endpoints.
@@ -35,22 +33,21 @@ The `v1` and `v2` will be removed in future versions.
* v1 does not include any endpoints for getting valid order statuses, v2 includes an endpoint for listing valid order statuses (`GET /orders/statuses`).
* v2 supports the core features added in WooCommerce 2.2, primarily order refunds (via the `/orders/refunds` endpoint) and Webhooks (via the `/webhooks`).
-### Differences between v3 and old versions ###
+### Differences between v3 and older versions ###
-* v3 implement full basic authentication ([conforms to the Basic auth spec)](http://tools.ietf.org/html/rfc2617)).
+* v3 implements full basic authentication ([conforms to the Basic auth spec)](http://tools.ietf.org/html/rfc2617)).
* v3 fixes the OAuth implementation to be compliant with the [Oauth 1.0a specs](http://tools.ietf.org/html/rfc5849).
-* v3 include a new endpoint to get all product orders.
-* v3 have new endpoints to allow bulk actions as edition and creation of products, orders, customers and coupons.
-* v3 introduce new product attribute endpoints (`GET`, `POST`, `PUT` and `DELETE`).
+* v3 includes a new endpoint to get all product orders.
+* v3 has new endpoints to allow bulk actions as edition and creation of products, orders, customers and coupons.
+* v3 introduces new product attribute endpoints (`GET`, `POST`, `PUT` and `DELETE`).
* v3 deprecated the product/sku/<id> endpoint (because a SKU can be generated with any character, besides that there is a filter callend `filter[sku]`).
-* v3 include category thumbnails on the requests for `product/categories`.
+* v3 includes category thumbnails on the requests for `product/categories`.
* v3 uses our option to auto generate passwords for new customers.
-### API Docs for each version ###
+### API Docs for past versions ###
* [WooCommerce REST API v1 docs](v1.html)
* [WooCommerce REST API v2 docs](v2.html)
-* [WooCommerce REST API v3 docs](index.html)
## Schema ##
@@ -58,7 +55,7 @@ The API is accessible via this endpoint:
`https://www.your-store.com/wc-api/v3`
-You may access the API over either HTTP or HTTPS. HTTPS is recommended where possible, as authentication is simpler. The API index will declare if the site supports SSL or not.
+*Pretty permalinks must be enabled*. You may access the API over either HTTP or HTTPS. *HTTPS is recommended where possible*, since authentication is simpler. The API index will declare if the site supports SSL or not.
## Requests/Responses ##
@@ -70,15 +67,15 @@ Some general information about responses:
* Resource IDs are returned as integers.
-* Any decimal monetary amount, such as prices or totals, are returned as strings with two decimal places. The decimal separator (typically either `.` or `,`) is controlled by the site and is included in the API index. This is by design, in order to make localization of API data easier for the client. You may need to account for this in your implemetation if you will be doing calculations with the returned data (e.g. convert string amounts with commas as the decimal place before performing any calculations)
+* Any decimal monetary amount, such as prices or totals, will be returned as strings with two decimal places. The decimal separator (typically either `.` or `,`) is controlled by the site and is included in the API index. This is by design in order to make localization of API data easier for the client. You may need to account for this in your implementation if you will be doing calculations with the returned data (e.g. converting string amounts with commas to decimal places before performing calculations).
* Other amounts, such as item counts, are returned as integers.
-* Blank fields are generally included as `null` instead of being blank strings or omitted.
+* Blank fields are generally included as `null` instead of being returned as blank strings or omitted.
## Authentication ##
-There are two aways to authenticate with the API, depending on whether the site supports SSL or not. Remember that the Index endpoint will indicate if the site supports SSL or not.
+There are two ways to authenticate with the API, depending on whether the site supports SSL. Remember that the Index endpoint will indicate if the site supports SSL.
### Over HTTPS ###
@@ -91,7 +88,7 @@ curl https://www.example.com/wc-api/v3/orders \
-u consumer_key:consumer_secret
```
-Occasionally some servers may not properly parse the Authorization header (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters.
+Occasionally some servers may not parse the Authorization header correctly (if you see a "Consumer key is missing" error when authenticating over SSL, you have a server issue). In this case, you may provide the consumer key/secret as query string parameters.
> Example for servers that not properly parse the Authorization header:
@@ -101,7 +98,7 @@ curl https://www.example.com/wc-api/v3/orders?consumer_key=123&consumer_secret=a
### Over HTTP ###
-You must use [OAuth 1.0a "one-legged" authentication](http://tools.ietf.org/html/rfc5849) to ensure API credentials cannot be intercepted. Typically you may use any standard OAuth 1.0a library in your language of choice to handle the authentication, or generate the necessary parameters by following these instructions.
+You must use [OAuth 1.0a "one-legged" authentication](http://tools.ietf.org/html/rfc5849) to ensure API credentials cannot be intercepted. Typically you will use any standard OAuth 1.0a library in the language of choice to handle the authentication, or generate the necessary parameters by following the following instructions.
#### Generating an OAuth signature ####
@@ -135,18 +132,18 @@ when encoded:
8) Generate the signature using the string to key and your consumer secret key
-If you are having trouble generating a correct signature, you'll want to review your string to sign for errors with encoding. The [authentication source](https://github.com/woothemes/woocommerce/blob/master/includes/api/class-wc-api-authentication.php#L177) can also be helpful in understanding how to properly generate the signature.
+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/woothemes/woocommerce/blob/master/includes/api/class-wc-api-authentication.php#L177) can also be helpful in understanding how to properly generate the signature.
#### OAuth Tips ####
* The OAuth parameters must be added as query string parameters and *not* included in the Authorization header. This is because there is no reliable cross-platform way to get the raw request headers in WordPress.
-* The require parameters are: `oauth_consumer_key`, `oauth_timestamp`, `oauth_nonce`, `oauth_signature`, and `oauth_signature_method`. `oauth_version` is not required and must be omitted.
+* The require parameters are: `oauth_consumer_key`, `oauth_timestamp`, `oauth_nonce`, `oauth_signature`, and `oauth_signature_method`. `oauth_version` is not required and should be omitted.
* HMAC-SHA1 or HMAC-SHA256 are the only accepted hash algorithms.
-* The OAuth nonce can be any randomly generated 32 character (recommended) string that is unique to the consumer key. Read more suggestions on [generating a nonce](https://dev.twitter.com/discussions/12445) on the Twitter API forums.
-* The OAuth timestamp should be the unix timestamp at the time of the request. The API will deny any requests that include a timestamp that is outside of a 15 minute window to prevent replay attacks.
+* The OAuth nonce can be any randomly generated 32 character (recommended) string that is unique to the consumer key. Read more suggestions on [generating nonces on the Twitter API forums](https://dev.twitter.com/discussions/12445).
+* The OAuth timestamp should be the unix timestamp at the time of the request. The 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)
* You may test your generated signature using LinkedIn's [OAuth test console](http://developer.linkedinlabs.com/oauth-test/) -- leave the member token/secret blank.
-* Twitter has great instructions on [generating a signature](https://dev.twitter.com/docs/auth/creating-signature) with OAuth 1.0a, but remember tokens are not used with this implementation.
+* Twitter has great instructions on [generating signatures](https://dev.twitter.com/docs/auth/creating-signature) with OAuth 1.0a, but remember tokens are not used with this implementation.
* Note that the request body is *not* signed as per the OAuth spec, see [Google's OAuth 1.0 extension](https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html) for details on why.
* If including filter fields in your request, it saves a lot of trouble if you can order your filter fields alphabetically before submitting. Many Oauth libraries won't order subquery fields properly, resulting in invalid signatures.
@@ -182,7 +179,7 @@ Note that the following filters are supported for all endpoints except the `repo
| `meta` | resource meta is excluded by default, but it can be included by setting `meta=true`, e.g. `GET /orders?filter[meta]=true`. Protected meta (meta whose key is prefixed with an underscore) is not included in the response |
| `pagination` | explained below |
-Note that Dates should be provided in [RFC3339](http://www.ietf.org/rfc/rfc3339.txt) format in UTC timezone: `YYYY-MM-DDTHH:MM:SSZ`. You may omit the time and timezone if desired.
+Note that Dates should be provided in [RFC3339](http://www.ietf.org/rfc/rfc3339.txt) format in the UTC timezone: `YYYY-MM-DDTHH:MM:SSZ`. You may omit the time and timezone if desired.
### Fields Parameter ###
@@ -204,7 +201,7 @@ Sub-fields can't be limited for resources that have multiple structs, like an or
## Pagination ##
-Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the `posts_per_page` option. Alternatively the items per page can be specifed with the `?filter[limit]` parameter:
+Requests that return multiple items will be paginated to 10 items by default. This default can be changed by the site administrator by changing the `posts_per_page` option. Alternatively the items per page can be specified with the `?filter[limit]` parameter:
`GET /orders?filter[limit]=15`
@@ -216,7 +213,7 @@ You may also specify the offset from the first resource using the `?filter[offse
`GET /orders?filter[offset]=5`
-Page number is 1-based and ommiting the `?page` parameter will return the first page.
+Page number is 1-based and omitting the `?page` parameter will return the first page.
The total number of resources and pages are always included in the `X-WC-Total` and `X-WC-TotalPages` HTTP headers.
@@ -301,13 +298,13 @@ Occasionally you might encounter errors when accessing the API. There are four p
}
```
-Errors return both an appropriate HTTP status code and response object which contains a `code` and `message` attribute. If an endpoint has any custom errors, they are documented with that endpoint.
+Errors return both an appropriate HTTP status code and response object which contains a `code` and `message` attribute. If an endpoint has any custom errors, they are documented within that endpoint.
## HTTP Verbs ##
The API uses the appropriate HTTP verb for each action:
-| Verbe | Description |
+| Verb | Description |
|----------|-------------------------------------------------------------------------|
| `HEAD` | Can be used for any endpoint to return just the HTTP header information |
| `GET` | Used for retrieving resources |
@@ -317,7 +314,7 @@ The API uses the appropriate HTTP verb for each action:
## JSONP Support ##
-The API supports JSONP by default. JSONP responses uses the `application/javascript` content-type. You can specify the callback using the `?_jsonp` parameter for `GET` requests to have the response wrapped in a JSON function:
+The API supports JSONP by default. JSONP responses use the `application/javascript` content-type. You can specify the callback using the `?_jsonp` parameter for `GET` requests to have the response wrapped in a JSON function:
@@ -366,7 +363,7 @@ curl https://example.com/wc-api/v3/orders/count?_jsonp=ordersCount \
## Webhooks ##
-Webhooks can be maneged by our interface or using the REST API endpoints. The `WC_Webhook` class manages all data storage/retrieval from the custom post type, as well as enqueuing a webhook's actions and processing/delivering/logging the webhook. On `woocommerce_init`, active webhooks are loaded and their associated hooks are added.
+Webhooks can be managed via the WooCommerce settings screen or by using the REST API endpoints. The `WC_Webhook` class manages all data storage and retrieval of the custom post type, as well as enqueuing webhook actions and processing/delivering/logging the webhook. On `woocommerce_init`, active webhooks are loaded and their associated hooks are added.
Each webhook has:
@@ -387,7 +384,7 @@ Core topics are:
* `order.created, order.updated, order.deleted`
* `product.created, product.updated, product.deleted`
-Custom topics can also be used which map to a single hook name, so for example you could add a webhook with topic `action.woocommerce_add_to_cart` that is triggered on that event. Custom topics pass the first hook argument to the payload, so in this example the `cart_item_key` would be included in the payload.
+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 ###
@@ -400,7 +397,7 @@ Delivery is done using `wp_remote_post()` (HTTP POST) and processed in the backg
* `X-WC-Webhook-ID` - webhook's post ID
* `X-WC-Delivery-ID` - delivery log ID (a comment)
-The payload is JSON encoded and for API resources (coupons,customers,orders,products), the response is exactly the same as if requested via the REST API.
+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 ###
@@ -432,6 +429,7 @@ You can find the Webhooks interface going to "WooCommerce" > "Settings" > "API"
## Official Libraries ##
- [Node.js](https://www.npmjs.com/package/woocommerce-api)
+- [PHP](https://packagist.org/packages/automattic/woocommerce)
- [Python](https://pypi.python.org/pypi/WooCommerce)
- [Ruby](https://rubygems.org/gems/woocommerce_api)
@@ -450,6 +448,27 @@ var WooCommerce = new WooCommerceAPI({
});
```
+```php
+ 'v3' // WooCommerce API version
+ ]
+);
+?>
+```
+
```python
# Install:
# pip install woocommerce
@@ -458,10 +477,10 @@ var WooCommerce = new WooCommerceAPI({
from woocommerce import API
wcapi = API(
- url="http://example.com",
- consumer_key="consumer_key",
- consumer_secret="consumer_secret",
- version="v3"
+ url="http://example.com", # Your store URL
+ consumer_key="consumer_key", # Your consumer key
+ consumer_secret="consumer_secret", # Your consumer secret
+ version="v3" # WooCommerce API version
)
```
@@ -473,17 +492,17 @@ wcapi = API(
require "woocommerce_api"
woocommerce = WooCommerce::API.new(
- "http://example.com",
- "consumer_key",
- "consumer_secret",
+ "http://example.com", # Your store URL
+ "consumer_key", # Your consumer key
+ "consumer_secret", # Your consumer secret
{
- version: "v3"
+ version: "v3" # WooCommerce API version
}
)
```
## Tools ##
diff --git a/source/includes/v3/_order-notes.md b/source/includes/v3/_order-notes.md
new file mode 100644
index 00000000..b1d1d834
--- /dev/null
+++ b/source/includes/v3/_order-notes.md
@@ -0,0 +1,336 @@
+# Order - Notes #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate order notes.
+
+## Order Notes Properties ##
+
+| Attribute | Type | Description |
+| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------ |
+| `id` | integer | Order note ID read-only |
+| `created_at` | string | UTC DateTime when the order note was created 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 a Note For an Order ##
+
+This API helps you to create a new note for an order.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/orders/<id>/notes
+
+
+
+```shell
+curl -X POST https://example.com/wc-api/v3/orders/645/notes \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "order_note": {
+ "note": "Order ok!!!"
+ }
+}'
+```
+
+```javascript
+var data = {
+ order_note: {
+ note: 'Order ok!!!'
+ }
+};
+
+WooCommerce.post('orders/645/notes', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'note' => 'Order ok!!!'
+ ]
+];
+
+print_r($woocommerce->post('orders/645/notes', $data));
+?>
+```
+
+```python
+data = {
+ "order_note": {
+ "note": "Order ok!!!"
+ }
+}
+
+print(wcapi.post("orders/645/notes", data).json())
+```
+
+```ruby
+data = {
+ order_note: {
+ note: "Order ok!!!"
+ }
+}
+
+woocommerce.post("orders/645/notes", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "order_note": {
+ "id": "416",
+ "created_at": "2015-01-26T20:56:44Z",
+ "note": "Order ok!!!",
+ "customer_note": false
+ }
+}
+```
+
+## View an Order Note ##
+
+This API lets you retrieve and view a specific note from an order.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/orders/<id>/notes/<note_id>
+
+
+
+```shell
+curl https://example.com/wc-api/v3/orders/645/notes/416 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('orders/645/notes/416', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('orders/645/notes/416')); ?>
+```
+
+```python
+print(wcapi.get("orders/645/notes/416").json())
+```
+
+```ruby
+woocommerce.get("orders/645/notes/416").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "order_note": {
+ "id": "416",
+ "created_at": "2015-01-26T20:56:44Z",
+ "note": "Order ok!!!",
+ "customer_note": false
+ }
+}
+```
+
+## View List of Notes From an Order ##
+
+This API helps you to view all the notes from an order.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/orders/<id>/notes
+
+
+
+```shell
+curl https://example.com/wc-api/v3/orders/645/notes \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('orders/645/notes', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('orders/645/notes')); ?>
+```
+
+```python
+print(wcapi.get("orders/645/notes").json())
+```
+
+```ruby
+woocommerce.get("orders/645/notes").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "order_notes": [
+ {
+ "id": "416",
+ "created_at": "2015-01-26T20:56:44Z",
+ "note": "Order ok!!!",
+ "customer_note": false
+ },
+ {
+ "id": "415",
+ "created_at": "2015-01-26T20:16:14Z",
+ "note": "Order status changed from Processing to Completed.",
+ "customer_note": false
+ },
+ {
+ "id": "412",
+ "created_at": "2015-01-26T20:00:21Z",
+ "note": "Order item stock reduced successfully.",
+ "customer_note": false
+ },
+ {
+ "id": "411",
+ "created_at": "2015-01-26T20:00:09Z",
+ "note": "Order status changed from Pending Payment to Processing.",
+ "customer_note": false
+ }
+ ]
+}
+```
+
+## Update an Order Note ##
+
+This API lets you make changes to an order note.
+
+### HTTP Request ###
+
+
+
+ PUT
+ /wc-api/v3/orders/<id>/notes/<note_id>
+
+
+
+```shell
+curl -X PUT https://example.com/wc-api/v3/orders/645/notes/416 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "order_note": {
+ "note": "Ok!"
+ }
+}'
+```
+
+```javascript
+var data = {
+ order_note: {
+ note: 'Ok!'
+ }
+};
+
+WooCommerce.put('orders/645/notes/416', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'note' => 'Ok!'
+ ]
+];
+
+print_r($woocommerce->put('orders/645/notes/416', $data));
+?>
+```
+
+```python
+data = {
+ "order_note": {
+ "note": "Ok!"
+ }
+}
+
+print(wcapi.put("orders/645/notes/416", data).json())
+```
+
+```ruby
+data = {
+ order_note: {
+ note: "Ok!"
+ }
+}
+
+woocommerce.put("orders/645/notes/416", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "order_note": {
+ "id": "416",
+ "created_at": "2015-01-26T20:56:44Z",
+ "note": "Ok!",
+ "customer_note": false
+ }
+}
+```
+
+## Delete an Order Note ##
+
+This API helps you delete an order note.
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/orders/<id>/notes/<note_id>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/orders/645/notes/416 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('orders/645/notes/416', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('orders/645/notes/416')); ?>
+```
+
+```python
+print(wcapi.delete("orders/645/notes/416").json())
+```
+
+```ruby
+woocommerce.delete("orders/645/notes/416").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Permanently deleted order note"
+}
+```
diff --git a/source/includes/v3/_order-refunds.md b/source/includes/v3/_order-refunds.md
new file mode 100644
index 00000000..402009e2
--- /dev/null
+++ b/source/includes/v3/_order-refunds.md
@@ -0,0 +1,359 @@
+# Order - Refunds #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate order refunds.
+
+## Order Refunds Properties ##
+
+| Attribute | Type | Description |
+| ------------ | ------- | ---------------------------------------------------------------------------------------- |
+| `id` | integer | Order note ID read-only |
+| `created_at` | string | UTC DateTime when the order refund was created read-only |
+| `amount` | float | Refund amount required |
+| `reason` | string | Reason for refund |
+| `line_items` | array | List of order items to refund. See [Line Items Properties](#line-items-properties) |
+
+## Create a Refund For an Order ##
+
+This API helps you to create a new refund for an order.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/orders/<id>/refunds
+
+
+
+```shell
+curl -X POST https://example.com/wc-api/v3/orders/645/refunds \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "order_refund": {
+ "amount": 10
+ }
+}'
+```
+
+```javascript
+var data = {
+ order_refund: {
+ amount: 10
+ }
+};
+
+WooCommerce.post('orders/645/refunds', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'amount' => 10
+ ]
+];
+
+print_r($woocommerce->post('orders/645/refunds', $data));
+?>
+```
+
+```python
+data = {
+ "order_refund": {
+ "amount": 10
+ }
+}
+
+print(wcapi.post("orders/645/refunds", data).json())
+```
+
+```ruby
+data = {
+ order_refund: {
+ amount: 10
+ }
+}
+
+woocommerce.post("orders/645/refunds", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "order_refund": {
+ "id": 649,
+ "created_at": "2015-01-26T19:29:32Z",
+ "amount": "10.00",
+ "reason": "",
+ "line_items": []
+ }
+}
+```
+
+## View an Order Refund ##
+
+This API lets you retrieve and view a specific refund from an order.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/orders/<id>/refunds/<refund_id>
+
+
+
+```shell
+curl https://example.com/wc-api/v3/orders/645/refunds/649 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('orders/645/refunds/649', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('orders/645/refunds/649')); ?>
+```
+
+```python
+print(wcapi.get("orders/645/refunds/649").json())
+```
+
+```ruby
+woocommerce.get("orders/645/refunds/649").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "order_refund": {
+ "id": 649,
+ "created_at": "2015-01-26T19:29:32Z",
+ "amount": "10.00",
+ "reason": "",
+ "line_items": []
+ }
+}
+```
+
+## View List of Refunds From an Order ##
+
+This API helps you to view all the refunds from an order.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/orders/<id>/refunds
+
+
+
+```shell
+curl https://example.com/wc-api/v3/orders/645/refunds \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('orders/645/refunds', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('orders/645/refunds')); ?>
+```
+
+```python
+print(wcapi.get("orders/645/refunds").json())
+```
+
+```ruby
+woocommerce.get("orders/645/refunds").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "order_refunds": [
+ {
+ "id": 649,
+ "created_at": "2015-01-26T19:29:32Z",
+ "amount": "10.00",
+ "reason": "",
+ "line_items": []
+ },
+ {
+ "id": 647,
+ "created_at": "2015-01-26T19:19:06Z",
+ "amount": "21.99",
+ "reason": "",
+ "line_items": [
+ {
+ "id": 514,
+ "subtotal": "-21.99",
+ "subtotal_tax": "0.00",
+ "total": "-21.99",
+ "total_tax": "0.00",
+ "price": "-21.99",
+ "quantity": 1,
+ "tax_class": "reduced-rate",
+ "name": "Premium Quality",
+ "product_id": 546,
+ "sku": "",
+ "meta": []
+ },
+ {
+ "id": 515,
+ "subtotal": "0.00",
+ "subtotal_tax": "0.00",
+ "total": "0.00",
+ "total_tax": "0.00",
+ "price": "0.00",
+ "quantity": 0,
+ "tax_class": null,
+ "name": "Ship Your Idea",
+ "product_id": 613,
+ "sku": "",
+ "meta": []
+ }
+ ]
+ }
+ ]
+}
+```
+
+## Update an Order Refund ##
+
+This API lets you make changes to an order refund.
+
+### HTTP Request ###
+
+
+
+ PUT
+ /wc-api/v3/orders/<id>/refunds/<refund_id>
+
+
+
+```shell
+curl -X PUT https://example.com/wc-api/v3/orders/645/refunds/649 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "order_refund": {
+ "reason": "Because was it necessary!"
+ }
+}'
+```
+
+```javascript
+var data = {
+ order_refund: {
+ reason: 'Because was it necessary!'
+ }
+};
+
+WooCommerce.put('orders/645/refunds/649', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'reason' => 'Because was it necessary!'
+ ]
+];
+
+print_r($woocommerce->put('orders/645/refunds/649', $data));
+?>
+```
+
+```python
+data = {
+ "order_refund": {
+ "reason": "Because was it necessary!"
+ }
+}
+
+print(wcapi.put("orders/645/refunds/649", data).json())
+```
+
+```ruby
+data = {
+ order_refund: {
+ reason: "Because was it necessary!"
+ }
+}
+
+woocommerce.put("orders/645/refunds/649", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "order_refund": {
+ "id": 649,
+ "created_at": "2015-01-26T19:29:32Z",
+ "amount": "10.00",
+ "reason": "Because was it necessary!",
+ "line_items": []
+ }
+}
+```
+
+## Delete an Order Refund ##
+
+This API helps you delete an order refund.
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/orders/<id>/refunds/<refund_id>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/orders/645/refunds/649 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('orders/645/refunds/649', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('orders/645/refunds/649')); ?>
+```
+
+```python
+print(wcapi.delete("orders/645/refunds/649").json())
+```
+
+```ruby
+woocommerce.delete("orders/645/refunds/649").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Permanently deleted refund"
+}
+```
diff --git a/source/includes/v3/_orders.md b/source/includes/v3/_orders.md
index 837fa1ca..c36d43f4 100644
--- a/source/includes/v3/_orders.md
+++ b/source/includes/v3/_orders.md
@@ -1,6 +1,6 @@
# Orders #
-This section lists all API that can be used to create, edit or otherwise manipulate orders.
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate orders.
## Orders Properties ##
@@ -111,7 +111,7 @@ This section lists all API that can be used to create, edit or otherwise manipul
| `code` | string | Coupon code required |
| `amount` | float | Total amount required |
-## Create An Order ##
+## Create an Order ##
This API helps you to create a new order.
@@ -243,6 +243,65 @@ WooCommerce.post('orders', data, function(err, data, res) {
});
```
+```php
+ [
+ 'payment_details' => [
+ 'method_id' => 'bacs',
+ 'method_title' => 'Direct Bank Transfer',
+ 'paid' => true
+ ],
+ 'billing_address' => [
+ 'first_name' => 'John',
+ 'last_name' => 'Doe',
+ 'address_1' => '969 Market',
+ 'address_2' => '',
+ 'city' => 'San Francisco',
+ 'state' => 'CA',
+ 'postcode' => '94103',
+ 'country' => 'US',
+ 'email' => 'john.doe@example.com',
+ 'phone' => '(555) 555-5555'
+ ],
+ 'shipping_address' => [
+ 'first_name' => 'John',
+ 'last_name' => 'Doe',
+ 'address_1' => '969 Market',
+ 'address_2' => '',
+ 'city' => 'San Francisco',
+ 'state' => 'CA',
+ 'postcode' => '94103',
+ 'country' => 'US'
+ ],
+ 'customer_id' => 2,
+ 'line_items' => [
+ [
+ 'product_id' => 546,
+ 'quantity' => 2
+ ],
+ [
+ 'product_id' => 613,
+ 'quantity' => 1,
+ 'variations' => [
+ 'pa_color' => 'Black'
+ ]
+ ]
+ ],
+ 'shipping_lines' => [
+ [
+ 'method_id' => 'flat_rate',
+ 'method_title' => 'Flat Rate',
+ 'total' => 10
+ ]
+ ]
+ ]
+];
+
+print_r($woocommerce->post('orders', $data));
+?>
+```
+
```python
data = {
"order": {
@@ -517,7 +576,7 @@ woocommerce.post("orders", data).parsed_response
}
```
-## View An Order ##
+## View an Order ##
This API lets you retrieve and view a specific order.
@@ -541,6 +600,10 @@ WooCommerce.get('orders/645', function(err, data, res) {
});
```
+```php
+get('orders/645')); ?>
+```
+
```python
print(wcapi.get("orders/645").json())
```
@@ -709,7 +772,17 @@ woocommerce.get("orders/645").parsed_response
}
```
-## View List Of Orders ##
+#### Available Filters ####
+
+| Filter | Type | Description |
+| -------- | ------ | --------------------------------------------------------------------------------------------- |
+| `expand` | string | Expand `coupons`, `products` and `taxes` objects, eg: `filter[expand]=coupons,products,taxes` |
+
+
+
+## View List of Orders ##
This API helps you to view all the orders.
@@ -733,6 +806,10 @@ WooCommerce.get('orders', function(err, data, res) {
});
```
+```php
+get('orders')); ?>
+```
+
```python
print(wcapi.get("orders").json())
```
@@ -1052,11 +1129,16 @@ woocommerce.get("orders").parsed_response
#### Available Filters ####
-| Filter | Type | Description |
-| -------- | ------ | ------------------------------------------------- |
-| `status` | string | Orders by status. eg: `processing` or `cancelled` |
+| Filter | Type | Description |
+| -------- | ------ | --------------------------------------------------------------------------------------------- |
+| `status` | string | Orders by status. eg: `processing` or `cancelled` |
+| `expand` | string | Expand `coupons`, `products` and `taxes` objects, eg: `filter[expand]=coupons,products,taxes` |
-## Update An Order ##
+
+
+## Update an Order ##
This API lets you make changes to an order.
@@ -1092,6 +1174,18 @@ WooCommerce.put('orders/645', data, function(err, data, res) {
});
```
+```php
+ [
+ 'status' => 'completed'
+ ]
+];
+
+print_r($woocommerce->put('orders/645', $data));
+?>
+```
+
```python
data = {
"order": {
@@ -1288,7 +1382,7 @@ To update is necessary to send objects containing IDs and to create new not just
```shell
-curl -X PUT https://example.com/wc-api/v3/orders/bulk \
+curl -X POST https://example.com/wc-api/v3/orders/bulk \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
@@ -1310,20 +1404,39 @@ var data = {
orders: [
{
id: 645,
- shipping_methods: "Local Delivery"
+ shipping_methods: 'Local Delivery'
},
{
id: 644,
- shipping_methods: "Local Delivery"
+ shipping_methods: 'Local Delivery'
}
]
};
-WooCommerce.put('orders/bulk', data, function(err, data, res) {
+WooCommerce.post('orders/bulk', data, function(err, data, res) {
console.log(res);
});
```
+```php
+ [
+ [
+ 'id' => 645,
+ 'shipping_methods' => 'Local Delivery'
+ ],
+ [
+ 'id' => 644,
+ 'shipping_methods' => 'Local Delivery'
+ ]
+ ]
+];
+
+print_r($woocommerce->post('orders/bulk', $data));
+?>
+```
+
```python
data = {
"orders": [
@@ -1338,7 +1451,7 @@ data = {
]
}
-print(wcapi.put("orders/bulk", data).json())
+print(wcapi.post("orders/bulk", data).json())
```
```ruby
@@ -1355,7 +1468,7 @@ data = {
]
}
-woocommerce.put("orders/bulk", data).parsed_response
+woocommerce.post("orders/bulk", data).parsed_response
```
> JSON response example:
@@ -1667,7 +1780,7 @@ woocommerce.put("orders/bulk", data).parsed_response
}
```
-## Delete An Order ##
+## Delete an Order ##
This API helps you delete an order.
@@ -1691,13 +1804,17 @@ WooCommerce.delete('orders/645/?force=true', function(err, data, res) {
});
```
+```php
+delete('orders/645', ['force' => true])); ?>
+```
+
```python
print(wcapi.delete("orders/645/?force=true").json())
```
```ruby
-woocommerce.delete("orders/645/?force=true").parsed_response
+woocommerce.delete("orders/645/", force: true).parsed_response
```
> JSON response example:
@@ -1738,6 +1855,10 @@ WooCommerce.get('orders/count', function(err, data, res) {
});
```
+```php
+get('orders/count')); ?>
+```
+
```python
print(wcapi.get("orders/count").json())
```
@@ -1760,7 +1881,7 @@ woocommerce.get("orders/count").parsed_response
| -------- | ------ | ------------------------------------------------- |
| `status` | string | Orders by status. eg: `processing` or `cancelled` |
-## View List Of Order Statuses ##
+## View List of Order Statuses ##
This API lets you retrieve a list of orders statuses available.
@@ -1784,6 +1905,10 @@ WooCommerce.get('orders/statuses', function(err, data, res) {
});
```
+```php
+get('orders/statuses')); ?>
+```
+
```python
print(wcapi.get("orders/statuses").json())
```
@@ -1807,644 +1932,3 @@ woocommerce.get("orders/statuses").parsed_response
}
}
```
-
-## Create A Note For An Order ##
-
-This API helps you to create a new note for an order.
-
-### HTTP Request ###
-
-
-
- POST
- /wc-api/v3/orders/<id>/notes
-
-
-
-```shell
-curl -X POST https://example.com/wc-api/v3/orders/645/notes \
- -u consumer_key:consumer_secret \
- -H "Content-Type: application/json" \
- -d '{
- "order_note": {
- "note": "Order ok!!!"
- }
-}'
-```
-
-```javascript
-var data = {
- order_note: {
- note: 'Order ok!!!'
- }
-};
-
-WooCommerce.post('orders/645/notes', data, function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-data = {
- "order_note": {
- "note": "Order ok!!!"
- }
-}
-
-print(wcapi.post("orders/645/notes", data).json())
-```
-
-```ruby
-data = {
- order_note: {
- note: "Order ok!!!"
- }
-}
-
-woocommerce.post("orders/645/notes", data).parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "order_note": {
- "id": "416",
- "created_at": "2015-01-26T20:56:44Z",
- "note": "Order ok!!!",
- "customer_note": false
- }
-}
-```
-
-### Order Notes Properties ###
-
-| Attribute | Type | Description |
-| --------------- | ------- | ------------------------------------------------------------------------------------------------------------------ |
-| `id` | integer | Order note ID read-only |
-| `created_at` | string | UTC DateTime when the order note was created 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` |
-
-## View An Order Note ##
-
-This API lets you retrieve and view a specific note from an order.
-
-### HTTP Request ###
-
-
-
- GET
- /wc-api/v3/orders/<id>/notes/<note_id>
-
-
-
-```shell
-curl https://example.com/wc-api/v3/orders/645/notes/416 \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.get('orders/645/notes/416', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.get("orders/645/notes/416").json())
-```
-
-```ruby
-woocommerce.get("orders/645/notes/416").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "order_note": {
- "id": "416",
- "created_at": "2015-01-26T20:56:44Z",
- "note": "Order ok!!!",
- "customer_note": false
- }
-}
-```
-
-
-
-## View List Of Notes From An Order ##
-
-This API helps you to view all the notes from an order.
-
-### HTTP Request ###
-
-
-
- GET
- /wc-api/v3/orders/<id>/notes
-
-
-
-```shell
-curl https://example.com/wc-api/v3/orders/645/notes \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.get('orders/645/notes', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.get("orders/645/notes").json())
-```
-
-```ruby
-woocommerce.get("orders/645/notes").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "order_notes": [
- {
- "id": "416",
- "created_at": "2015-01-26T20:56:44Z",
- "note": "Order ok!!!",
- "customer_note": false
- },
- {
- "id": "415",
- "created_at": "2015-01-26T20:16:14Z",
- "note": "Order status changed from Processing to Completed.",
- "customer_note": false
- },
- {
- "id": "412",
- "created_at": "2015-01-26T20:00:21Z",
- "note": "Order item stock reduced successfully.",
- "customer_note": false
- },
- {
- "id": "411",
- "created_at": "2015-01-26T20:00:09Z",
- "note": "Order status changed from Pending Payment to Processing.",
- "customer_note": false
- }
- ]
-}
-```
-
-
-
-## Update An Order Note ##
-
-This API lets you make changes to an order note.
-
-### HTTP Request ###
-
-
-
- PUT
- /wc-api/v3/orders/<id>/notes/<note_id>
-
-
-
-```shell
-curl -X PUT https://example.com/wc-api/v3/orders/645/notes/416 \
- -u consumer_key:consumer_secret \
- -H "Content-Type: application/json" \
- -d '{
- "order_note": {
- "note": "Ok!"
- }
-}'
-```
-
-```javascript
-var data = {
- order_note: {
- note: 'Ok!'
- }
-};
-
-WooCommerce.put('orders/645/notes/416', data, function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-data = {
- "order_note": {
- "note": "Ok!"
- }
-}
-
-print(wcapi.put("orders/645/notes/416", data).json())
-```
-
-```ruby
-data = {
- order_note: {
- note: "Ok!"
- }
-}
-
-woocommerce.put("orders/645/notes/416", data).parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "order_note": {
- "id": "416",
- "created_at": "2015-01-26T20:56:44Z",
- "note": "Ok!",
- "customer_note": false
- }
-}
-```
-
-
-
-## Delete An Order Note ##
-
-This API helps you delete an order note.
-
-### HTTP Request ###
-
-
-
- DELETE
- /wc-api/v3/orders/<id>/notes/<note_id>
-
-
-
-```shell
-curl -X DELETE https://example.com/wc-api/v3/orders/645/notes/416 \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.delete('orders/645/notes/416', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.delete("orders/645/notes/416").json())
-```
-
-```ruby
-woocommerce.delete("orders/645/notes/416").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "message": "Permanently deleted order note"
-}
-```
-
-## Create A Refund For An Order ##
-
-This API helps you to create a new refund for an order.
-
-### HTTP Request ###
-
-
-
- POST
- /wc-api/v3/orders/<id>/refunds
-
-
-
-```shell
-curl -X POST https://example.com/wc-api/v3/orders/645/refunds \
- -u consumer_key:consumer_secret \
- -H "Content-Type: application/json" \
- -d '{
- "order_refund": {
- "amount": 10
- }
-}'
-```
-
-```javascript
-var data = {
- order_refund: {
- amount: 10
- }
-};
-
-WooCommerce.post('orders/645/refunds', data, function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-data = {
- "order_refund": {
- "amount": 10
- }
-}
-
-print(wcapi.post("orders/645/refunds", data).json())
-```
-
-```ruby
-data = {
- order_refund: {
- amount: 10
- }
-}
-
-woocommerce.post("orders/645/refunds", data).parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "order_refund": {
- "id": 649,
- "created_at": "2015-01-26T19:29:32Z",
- "amount": "10.00",
- "reason": "",
- "line_items": []
- }
-}
-```
-
-### Order Refunds Properties ###
-
-| Attribute | Type | Description |
-| ------------ | ------- | ---------------------------------------------------------------------------------------- |
-| `id` | integer | Order note ID read-only |
-| `created_at` | string | UTC DateTime when the order refund was created read-only |
-| `amount` | float | Refund amount required |
-| `reason` | string | Reason for refund |
-| `line_items` | array | List of order items to refund. See [Line Items Properties](line-items-properties) |
-
-## View An Order Refund ##
-
-This API lets you retrieve and view a specific refund from an order.
-
-### HTTP Request ###
-
-
-
- GET
- /wc-api/v3/orders/<id>/refunds/<refund_id>
-
-
-
-```shell
-curl https://example.com/wc-api/v3/orders/645/refunds/649 \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.get('orders/645/refunds/649', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.get("orders/645/refunds/649").json())
-```
-
-```ruby
-woocommerce.get("orders/645/refunds/649").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "order_refund": {
- "id": 649,
- "created_at": "2015-01-26T19:29:32Z",
- "amount": "10.00",
- "reason": "",
- "line_items": []
- }
-}
-```
-
-
-
-## View List Of Refunds From An Order ##
-
-This API helps you to view all the refunds from an order.
-
-### HTTP Request ###
-
-
-
- GET
- /wc-api/v3/orders/<id>/refunds
-
-
-
-```shell
-curl https://example.com/wc-api/v3/orders/645/refunds \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.get('orders/645/refunds', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.get("orders/645/refunds").json())
-```
-
-```ruby
-woocommerce.get("orders/645/refunds").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "order_refunds": [
- {
- "id": 649,
- "created_at": "2015-01-26T19:29:32Z",
- "amount": "10.00",
- "reason": "",
- "line_items": []
- },
- {
- "id": 647,
- "created_at": "2015-01-26T19:19:06Z",
- "amount": "21.99",
- "reason": "",
- "line_items": [
- {
- "id": 514,
- "subtotal": "-21.99",
- "subtotal_tax": "0.00",
- "total": "-21.99",
- "total_tax": "0.00",
- "price": "-21.99",
- "quantity": 1,
- "tax_class": "reduced-rate",
- "name": "Premium Quality",
- "product_id": 546,
- "sku": "",
- "meta": []
- },
- {
- "id": 515,
- "subtotal": "0.00",
- "subtotal_tax": "0.00",
- "total": "0.00",
- "total_tax": "0.00",
- "price": "0.00",
- "quantity": 0,
- "tax_class": null,
- "name": "Ship Your Idea",
- "product_id": 613,
- "sku": "",
- "meta": []
- }
- ]
- }
- ]
-}
-```
-
-
-
-## Update An Order Refund ##
-
-This API lets you make changes to an order refund.
-
-### HTTP Request ###
-
-
-
- PUT
- /wc-api/v3/orders/<id>/refunds/<refund_id>
-
-
-
-```shell
-curl -X PUT https://example.com/wc-api/v3/orders/645/refunds/649 \
- -u consumer_key:consumer_secret \
- -H "Content-Type: application/json" \
- -d '{
- "order_refund": {
- "reason": "Because was it necessary!"
- }
-}'
-```
-
-```javascript
-var data = {
- order_refund: {
- reason: 'Because was it necessary!'
- }
-};
-
-WooCommerce.put('orders/645/refunds/649', data, function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-data = {
- "order_refund": {
- "reason": "Because was it necessary!"
- }
-}
-
-print(wcapi.put("orders/645/refunds/649", data).json())
-```
-
-```ruby
-data = {
- order_refund: {
- reason: "Because was it necessary!"
- }
-}
-
-woocommerce.put("orders/645/refunds/649", data).parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "order_refund": {
- "id": 649,
- "created_at": "2015-01-26T19:29:32Z",
- "amount": "10.00",
- "reason": "Because was it necessary!",
- "line_items": []
- }
-}
-```
-
-
-
-## Delete An Order Refund ##
-
-This API helps you delete an order refund.
-
-### HTTP Request ###
-
-
-
- DELETE
- /wc-api/v3/orders/<id>/refunds/<refund_id>
-
-
-
-```shell
-curl -X DELETE https://example.com/wc-api/v3/orders/645/refunds/649 \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.delete('orders/645/refunds/649', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.delete("orders/645/refunds/649").json())
-```
-
-```ruby
-woocommerce.delete("orders/645/refunds/649").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "message": "Permanently deleted refund"
-}
-```
diff --git a/source/includes/v3/_product-attribute-terms.md b/source/includes/v3/_product-attribute-terms.md
new file mode 100644
index 00000000..6a6875ec
--- /dev/null
+++ b/source/includes/v3/_product-attribute-terms.md
@@ -0,0 +1,370 @@
+# Product - Attribute Terms #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate product attribute terms.
+
+## Product Attribute Properties ##
+
+| Attribute | Type | Description |
+| --------- | ------- | ------------------------------------------------------------------------------------- |
+| `id` | integer | Term ID (term ID) read-only |
+| `name` | string | Term name required |
+| `slug` | string | Term slug |
+| `count` | boolean | Shows the quantity of products in this term read-only |
+
+## Create a Product Attribute Term ##
+
+This API helps you to create a new product attribute term.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/products/attributes/<attribute_id>/terms
+
+
+
+```shell
+curl -X POST https://example.com/wc-api/v3/products/attributes/1/terms \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_attribute_term": {
+ "name": "Black"
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_attribute_term: {
+ name: 'Black'
+ }
+};
+
+WooCommerce.post('products/attributes/1/terms', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'name' => 'Black'
+ ]
+];
+
+print_r($woocommerce->post('products/attributes/1/terms', $data));
+?>
+```
+
+```python
+data = {
+ "product_attribute_term": {
+ "name": "Black"
+ }
+}
+
+print(wcapi.post("products/attributes/1/terms", data).json())
+```
+
+```ruby
+data = {
+ product_attribute_term: {
+ name: "Black"
+ }
+}
+
+woocommerce.post("products/attributes/1/terms", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_attribute_term": {
+ "id": 18,
+ "name": "Black",
+ "slug": "black",
+ "count": 0
+ }
+}
+```
+
+
+
+## View a Product Attribute Term ##
+
+This API lets you retrieve a product attribute term by ID.
+
+
+
+ GET
+ /wc-api/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/attributes/1/terms/18 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/attributes/1/terms/18', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/attributes/1/terms/18')); ?>
+```
+
+```python
+print(wcapi.get("products/attributes/1/terms/18").json())
+```
+
+```ruby
+woocommerce.get("products/attributes/1/terms/18").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_attribute_term": {
+ "id": 18,
+ "name": "Black",
+ "slug": "black",
+ "count": 5
+ }
+}
+```
+
+
+
+## View List of Product Attribute Terms ##
+
+This API lets you retrieve all terms from a product attribute.
+
+
+
+ GET
+ /wc-api/v3/products/attributes/<attribute_id>/terms
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/attributes/1/terms \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/attributes/1/terms', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/attributes/1/terms')); ?>
+```
+
+```python
+print(wcapi.get("products/attributes/1/terms").json())
+```
+
+```ruby
+woocommerce.get("products/attributes/1/terms").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_attribute_terms": [
+ {
+ "id": 18,
+ "slug": "black",
+ "name": "Black",
+ "count": 5
+ },
+ {
+ "id": 20,
+ "slug": "blue",
+ "name": "Blue",
+ "count": 4
+ },
+ {
+ "id": 19,
+ "slug": "green",
+ "name": "Green",
+ "count": 4
+ },
+ {
+ "id": 24,
+ "slug": "pink",
+ "name": "Pink",
+ "count": 3
+ },
+ {
+ "id": 22,
+ "slug": "red",
+ "name": "Red",
+ "count": 3
+ },
+ {
+ "id": 21,
+ "slug": "white",
+ "name": "White",
+ "count": 3
+ },
+ {
+ "id": 23,
+ "slug": "yellow",
+ "name": "Yellow",
+ "count": 3
+ }
+ ]
+}
+```
+
+
+
+## Update a Product Attribute Term ##
+
+This API lets you make changes to a product attribute term.
+
+### HTTP Request ###
+
+
+
+ PUT
+ /wc-api/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
+```shell
+curl -X PUT https://example.com/wc-api/v3/products/attributes/1/terms/18 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_attribute_term": {
+ "name": "BLACK"
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_attribute_term: {
+ name: 'BLACK'
+ }
+};
+
+WooCommerce.put('products/attributes/1/terms/18', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'name' => 'BLACK'
+ ]
+];
+
+print_r($woocommerce->put('products/attributes/1/terms/18', $data));
+?>
+```
+
+```python
+data = {
+ "product_attribute_term": {
+ "name": "BLACK"
+ }
+}
+
+print(wcapi.put("products/attributes/1/terms/18", data).json())
+```
+
+```ruby
+data = {
+ product_attribute_term: {
+ name: "BLACK"
+ }
+}
+
+woocommerce.put("products/attributes/1/terms/18", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_attribute_term": {
+ "id": 18,
+ "name": "BLACK",
+ "slug": "black",
+ "count": 5
+ }
+}
+```
+
+
+
+## Delete a Product Attribute Term ##
+
+This API helps you delete a product attribute term.
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/products/attributes/<attribute_id>/terms/<id>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/products/attributes/1/terms/18 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('products/attributes/1/terms/18', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('products/attributes/1/terms/18')); ?>
+```
+
+```python
+print(wcapi.delete("products/attributes/1/terms/18").json())
+```
+
+```ruby
+woocommerce.delete("products/attributes/1/terms/18").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Deleted product_attribute_term"
+}
+```
+
+
diff --git a/source/includes/v3/_product-attributes.md b/source/includes/v3/_product-attributes.md
new file mode 100644
index 00000000..112668d1
--- /dev/null
+++ b/source/includes/v3/_product-attributes.md
@@ -0,0 +1,354 @@
+# Product - Attributes #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate product attributes.
+
+## Product Attribute Properties ##
+
+| Attribute | Type | Description |
+| -------------- | ------- | -------------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Attribute ID read-only |
+| `name` | string | Attribute name |
+| `slug` | string | Attribute slug |
+| `type` | string | Attribute type, the types available include by default are: `select` and `text` (some plugins can include new types) |
+| `order_by` | string | Default sort order. Available: `menu_order`, `name`, `name_num` and `id` |
+| `has_archives` | boolean | Enable/Disable attribute archives |
+
+## Create a Product Attribute ##
+
+This API helps you to create a new product attribute.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/products/attributes
+
+
+
+```shell
+curl -X POST https://example.com/wc-api/v3/products/attributes \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_attribute": {
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": true
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_attribute: {
+ name: 'Color',
+ slug: 'pa_color',
+ type: 'select',
+ order_by: 'menu_order',
+ has_archives: true
+ }
+};
+
+WooCommerce.post('products/attributes', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'name' => 'Color',
+ 'slug' => 'pa_color',
+ 'type' => 'select',
+ 'order_by' => 'menu_order',
+ 'has_archives' => true
+ ]
+];
+
+print_r($woocommerce->post('products/attributes', $data));
+?>
+```
+
+```python
+data = {
+ "product_attribute": {
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": True
+ }
+}
+
+print(wcapi.post("products/attributes", data).json())
+```
+
+```ruby
+data = {
+ product_attribute: {
+ name: "Color",
+ slug: "pa_color",
+ type: "select",
+ order_by: "menu_order",
+ has_archives: true
+ }
+}
+
+woocommerce.post("products/attributes", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_attribute": {
+ "id": 1,
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": true
+ }
+}
+```
+
+## View a Product Attribute ##
+
+This API lets you retrieve and view a specific product attribute by ID.
+
+
+
+ GET
+ /wc-api/v3/products/attributes/<id>
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/attributes/1 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/attributes/1', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/attributes/1')); ?>
+```
+
+```python
+print(wcapi.get("products/attributes/1").json())
+```
+
+```ruby
+woocommerce.get("products/attributes/1").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_attribute": {
+ "id": 1,
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": true
+ }
+}
+```
+
+## View List of Product Attributes ##
+
+This API helps you to view all the product attributes.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/products/attributes
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/attributes \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/attributes', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/attributes')); ?>
+```
+
+```python
+print(wcapi.get("products/attributes").json())
+```
+
+```ruby
+woocommerce.get("products/attributes").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_attributes": [
+ {
+ "id": 1,
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": true
+ },
+ {
+ "id": 2,
+ "name": "Size",
+ "slug": "pa_size",
+ "type": "select",
+ "order_by": "menu_order",
+ "has_archives": false
+ }
+ ]
+}
+```
+
+## Update a Product Attribute ##
+
+This API lets you make changes to a product attribute.
+
+### HTTP Request ###
+
+
+
+ PUT
+ /wc-api/v3/products/attributes/<id>
+
+
+
+```shell
+curl -X PUT https://example.com/wc-api/v3/products/attributes/1 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_attribute": {
+ "order_by": "name"
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_attribute: {
+ order_by: 'name'
+ }
+};
+
+WooCommerce.put('products/attributes/1', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'order_by' => 'name'
+ ]
+];
+
+print_r($woocommerce->put('products/attributes/1', $data));
+?>
+```
+
+```python
+data = {
+ "product_attribute": {
+ "order_by": "name"
+ }
+}
+
+print(wcapi.put("products/attributes/1", data).json())
+```
+
+```ruby
+data = {
+ product_attribute: {
+ order_by: "name"
+ }
+}
+
+woocommerce.put("products/attributes/1", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_attribute": {
+ "id": 1,
+ "name": "Color",
+ "slug": "pa_color",
+ "type": "select",
+ "order_by": "name",
+ "has_archives": true
+ }
+}
+```
+
+## Delete a Product Attribute ##
+
+This API helps you delete a product attribute.
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/products/attributes/<id>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/products/attributes/1 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('products/attributes/1', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('products/attributes/1')); ?>
+```
+
+```python
+print(wcapi.delete("products/attributes/1").json())
+```
+
+```ruby
+woocommerce.delete("products/attributes/1").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Deleted product_attribute"
+}
+```
diff --git a/source/includes/v3/_product-categories.md b/source/includes/v3/_product-categories.md
new file mode 100644
index 00000000..3ad89505
--- /dev/null
+++ b/source/includes/v3/_product-categories.md
@@ -0,0 +1,408 @@
+# Product - Categories #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate product categories.
+
+## Product Category Properties ##
+
+| Attribute | Type | Description |
+| ------------- | ------- | ------------------------------------------------------------------------------------------------------------- |
+| `id` | integer | Category ID (term ID) read-only |
+| `name` | string | Category name required |
+| `slug` | string | Category slug |
+| `parent` | integer | Category parent |
+| `description` | string | Category description |
+| `display` | string | Category archive display type, the types available include: `default`, `products`, `subcategories` and `both` |
+| `image` | string | Category image URL |
+| `count` | boolean | Shows the quantity of products in this category read-only |
+
+## Create a Product Category ##
+
+This API helps you to create a new product category.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/products/categories
+
+
+
+> Example of how to create a product category:
+
+```shell
+curl -X POST https://example.com/wc-api/v3/products/categories \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_category": {
+ "name": "Clothing"
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_category: {
+ name: 'Clothing'
+ }
+};
+
+WooCommerce.post('products/categories', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'name' => 'Clothing'
+ ]
+];
+
+print_r($woocommerce->post('products/categories', $data));
+?>
+```
+
+```python
+data = {
+ "product_category": {
+ "name": "Clothing"
+ }
+}
+
+print(wcapi.post("products/categories", data).json())
+```
+
+```ruby
+data = {
+ product_category: {
+ name: "Clothing"
+ }
+}
+
+woocommerce.post("products/categories", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_category": {
+ "id": 9,
+ "name": "Clothing",
+ "slug": "clothing",
+ "parent": 0,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 0
+ }
+}
+```
+
+
+
+## View a Product Category ##
+
+This API lets you retrieve a product category by ID.
+
+
+
+ GET
+ /wc-api/v3/products/categories/<id>
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/categories/9 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/categories/9', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/categories/9')); ?>
+```
+
+```python
+print(wcapi.get("products/categories/9").json())
+```
+
+```ruby
+woocommerce.get("products/categories/9").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_category": {
+ "id": 9,
+ "name": "Clothing",
+ "slug": "clothing",
+ "parent": 0,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 23
+ }
+}
+```
+
+## View List of Product Categories ##
+
+This API lets you retrieve all product categories.
+
+
+
+ GET
+ /wc-api/v3/products/categories
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/categories \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/categories', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/categories')); ?>
+```
+
+```python
+print(wcapi.get("products/categories").json())
+```
+
+```ruby
+woocommerce.get("products/categories").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_categories": [
+ {
+ "id": 15,
+ "name": "Albums",
+ "slug": "albums",
+ "parent": 11,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 4
+ },
+ {
+ "id": 9,
+ "name": "Clothing",
+ "slug": "clothing",
+ "parent": 0,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 23
+ },
+ {
+ "id": 10,
+ "name": "Hoodies",
+ "slug": "hoodies",
+ "parent": 9,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 6
+ },
+ {
+ "id": 11,
+ "name": "Music",
+ "slug": "music",
+ "parent": 0,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 6
+ },
+ {
+ "id": 12,
+ "name": "Posters",
+ "slug": "posters",
+ "parent": 0,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 5
+ },
+ {
+ "id": 13,
+ "name": "Singles",
+ "slug": "singles",
+ "parent": 11,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 2
+ },
+ {
+ "id": 14,
+ "name": "T-shirts",
+ "slug": "t-shirts",
+ "parent": 9,
+ "description": "",
+ "display": "default",
+ "image": "",
+ "count": 17
+ }
+ ]
+}
+```
+
+## Update a Product Category ##
+
+This API lets you make changes to a product category.
+
+### HTTP Request ###
+
+
+
+ PUT
+ /wc-api/v3/products/categories/<id>
+
+
+
+```shell
+curl -X PUT https://example.com/wc-api/v3/products/categories/9 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_category": {
+ "description": "All kinds of clothes."
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_category: {
+ description: 'All kinds of clothes.'
+ }
+};
+
+WooCommerce.put('products/categories/9', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'description' => 'All kinds of clothes.'
+ ]
+];
+
+print_r($woocommerce->put('products/categories/9', $data));
+?>
+```
+
+```python
+data = {
+ "product_category": {
+ "description": "All kinds of clothes."
+ }
+}
+
+print(wcapi.put("products/categories/9", data).json())
+```
+
+```ruby
+data = {
+ product_category: {
+ description: "All kinds of clothes."
+ }
+}
+
+woocommerce.put("products/categories/9", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_category": {
+ "id": 9,
+ "name": "Clothing",
+ "slug": "clothing",
+ "parent": 0,
+ "description": "All kinds of clothes.",
+ "display": "default",
+ "image": "",
+ "count": 23
+ }
+}
+```
+
+
+
+## Delete a Product Category ##
+
+This API helps you delete a product category.
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/products/categories/<id>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/products/categories/9 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('products/categories/9', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('products/categories/9')); ?>
+```
+
+```python
+print(wcapi.delete("products/categories/9").json())
+```
+
+```ruby
+woocommerce.delete("products/categories/9").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Deleted product_category"
+}
+```
+
+
diff --git a/source/includes/v3/_product-shipping-classes.md b/source/includes/v3/_product-shipping-classes.md
new file mode 100644
index 00000000..7117d784
--- /dev/null
+++ b/source/includes/v3/_product-shipping-classes.md
@@ -0,0 +1,354 @@
+# Product - Shipping Classes #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate product shipping classes.
+
+## Product Shipping Class Properties ##
+
+| Attribute | Type | Description |
+| ------------- | ------- | ----------------------------------------------------------------------------------------------- |
+| `id` | integer | Shipping Class ID (term ID) read-only |
+| `name` | string | Shipping Class name required |
+| `slug` | string | Shipping Class slug |
+| `parent` | integer | Shipping Class parent |
+| `description` | string | Shipping Class description |
+| `count` | boolean | Shows the quantity of products in this shipping class read-only |
+
+## Create a Product Shipping Class ##
+
+This API helps you to create a new product shipping class.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/products/shipping_classes
+
+
+
+> Example of how to create a product shipping class:
+
+```shell
+curl -X POST https://example.com/wc-api/v3/products/shipping_classes \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_shipping_class": {
+ "name": "Priority"
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_shipping_class: {
+ name: 'Priority'
+ }
+};
+
+WooCommerce.post('products/shipping_classes', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'name' => 'Priority'
+ ]
+];
+
+print_r($woocommerce->post('products/shipping_classes', $data));
+?>
+```
+
+```python
+data = {
+ "product_shipping_class": {
+ "name": "Priority"
+ }
+}
+
+print(wcapi.post("products/shipping_classes", data).json())
+```
+
+```ruby
+data = {
+ product_shipping_class: {
+ name: "Priority"
+ }
+}
+
+woocommerce.post("products/shipping_classes", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_shipping_class": {
+ "id": 35,
+ "name": "Priority",
+ "slug": "priority",
+ "parent": 0,
+ "description": "",
+ "count": 0
+ }
+}
+```
+
+
+
+## View a Product Shipping Class ##
+
+This API lets you retrieve a product shipping class by ID.
+
+
+
+ GET
+ /wc-api/v3/products/shipping_classes/<id>
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/shipping_classes/35 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/shipping_classes/35', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/shipping_classes/35')); ?>
+```
+
+```python
+print(wcapi.get("products/shipping_classes/35").json())
+```
+
+```ruby
+woocommerce.get("products/shipping_classes/35").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_shipping_class": {
+ "id": 35,
+ "name": "Priority",
+ "slug": "priority",
+ "parent": 0,
+ "description": "",
+ "count": 0
+ }
+}
+```
+
+
+
+## View List of Product Shipping Classes ##
+
+This API lets you retrieve all product shipping classes.
+
+
+
+ GET
+ /wc-api/v3/products/shipping_classes
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/shipping_classes \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/shipping_classes', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/shipping_classes')); ?>
+```
+
+```python
+print(wcapi.get("products/shipping_classes").json())
+```
+
+```ruby
+woocommerce.get("products/shipping_classes").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_shipping_classes": [
+ {
+ "id": 30,
+ "name": "Express",
+ "slug": "express",
+ "parent": 0,
+ "description": "",
+ "count": 1
+ },
+ {
+ "id": 35,
+ "name": "Priority",
+ "slug": "priority",
+ "parent": 0,
+ "description": "",
+ "count": 0
+ }
+ ]
+}
+```
+
+
+
+## Update a Product Shipping Class ##
+
+This API lets you make changes to a product shipping class.
+
+### HTTP Request ###
+
+
+
+ PUT
+ /wc-api/v3/products/shipping_classes/<id>
+
+
+
+```shell
+curl -X PUT https://example.com/wc-api/v3/products/shipping_classes/35 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_shipping_class": {
+ "description": "Priority mail."
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_shipping_class: {
+ description: 'Priority mail.'
+ }
+};
+
+WooCommerce.put('products/shipping_classes/35', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'description' => 'Priority mail.'
+ ]
+];
+
+print_r($woocommerce->put('products/shipping_classes/35', $data));
+?>
+```
+
+```python
+data = {
+ "product_shipping_class": {
+ "description": "Priority mail."
+ }
+}
+
+print(wcapi.put("products/shipping_classes/35", data).json())
+```
+
+```ruby
+data = {
+ product_shipping_class: {
+ description: "Priority mail."
+ }
+}
+
+woocommerce.put("products/shipping_classes/35", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_shipping_class": {
+ "id": 35,
+ "name": "Priority",
+ "slug": "priority",
+ "parent": 0,
+ "description": "Priority mail.",
+ "count": 0
+ }
+}
+```
+
+
+
+## Delete a Product Shipping Class ##
+
+This API helps you delete a product shipping class.
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/products/shipping_class/<id>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/products/shipping_class/35 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('products/shipping_class/35', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('products/shipping_classes/35')); ?>
+```
+
+```python
+print(wcapi.delete("products/shipping_class/35").json())
+```
+
+```ruby
+woocommerce.delete("products/shipping_class/35").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Deleted product_shipping_class"
+}
+```
+
+
diff --git a/source/includes/v3/_product-tags.md b/source/includes/v3/_product-tags.md
new file mode 100644
index 00000000..b7e0c520
--- /dev/null
+++ b/source/includes/v3/_product-tags.md
@@ -0,0 +1,348 @@
+# Product - Tags #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate product tags.
+
+## Product Tag Properties ##
+
+| Attribute | Type | Description |
+| ------------- | ------- | ------------------------------------------------------------------------------------ |
+| `id` | integer | Tag ID (term ID) read-only |
+| `name` | string | Tag name required |
+| `slug` | string | Tag slug |
+| `description` | string | Tag description |
+| `count` | boolean | Shows the quantity of products in this tag read-only |
+
+## Create a Product Tag ##
+
+This API helps you to create a new product tag.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/products/tags
+
+
+
+> Example of how to create a product tag:
+
+```shell
+curl -X POST https://example.com/wc-api/v3/products/tags \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_tag": {
+ "name": "Leather Shoes"
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_tag: {
+ name: 'Leather Shoes'
+ }
+};
+
+WooCommerce.post('products/tags', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+post('products/tags', $data));
+?>
+```
+
+```python
+data = {
+ "product_tag": {
+ "name": "Leather Shoes"
+ }
+}
+
+print(wcapi.post("products/tags", data).json())
+```
+
+```ruby
+data = {
+ product_tag: {
+ name: "Leather Shoes"
+ }
+}
+
+woocommerce.post("products/tags", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_tag": {
+ "id": 37,
+ "name": "Leather Shoes",
+ "slug": "leather-shoes",
+ "description": "",
+ "count": 0
+ }
+}
+```
+
+
+
+## View a Product Tag ##
+
+This API lets you retrieve a product tag by ID.
+
+
+
+ GET
+ /wc-api/v3/products/tags/<id>
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/tags/37 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/tags/37', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/tags/37')); ?>
+```
+
+```python
+print(wcapi.get("products/tags/37").json())
+```
+
+```ruby
+woocommerce.get("products/tags/37").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_tag": {
+ "id": 37,
+ "name": "Leather Shoes",
+ "slug": "leather-shoes",
+ "description": "",
+ "count": 0
+ }
+}
+```
+
+
+
+## View List of Product Tags ##
+
+This API lets you retrieve all product tag.
+
+
+
+ GET
+ /wc-api/v3/products/tags
+
+
+
+```shell
+curl https://example.com/wc-api/v3/products/tags \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('products/tags', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('products/tags')); ?>
+```
+
+```python
+print(wcapi.get("products/tags").json())
+```
+
+```ruby
+woocommerce.get("products/tags").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_tags": [
+ {
+ "id": 37,
+ "name": "Leather Shoes",
+ "slug": "leather-shoes",
+ "description": "",
+ "count": 0
+ },
+ {
+ "id": 38,
+ "name": "Oxford Shoes",
+ "slug": "oxford-shoes",
+ "description": "",
+ "count": 0
+ }
+ ]
+}
+```
+
+
+
+## Update a Product Tag ##
+
+This API lets you make changes to a product tag.
+
+### HTTP Request ###
+
+
+
+ PUT
+ /wc-api/v3/products/tags/<id>
+
+
+
+```shell
+curl -X PUT https://example.com/wc-api/v3/products/tags/37 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "product_tag": {
+ "description": "Genuine leather."
+ }
+}'
+```
+
+```javascript
+var data = {
+ product_tag: {
+ description: 'Genuine leather.'
+ }
+};
+
+WooCommerce.put('products/tags/37', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+put('products/tags/37', $data));
+?>
+```
+
+```python
+data = {
+ "product_tag": {
+ "description": "Genuine leather."
+ }
+}
+
+print(wcapi.put("products/tags/37", data).json())
+```
+
+```ruby
+data = {
+ product_tag: {
+ description: "Genuine leather."
+ }
+}
+
+woocommerce.put("products/tags/37", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "product_tag": {
+ "id": 37,
+ "name": "Leather Shoes",
+ "slug": "leather-shoes",
+ "description": "Genuine leather.",
+ "count": 0
+ }
+}
+```
+
+
+
+## Delete a Product Tag ##
+
+This API helps you delete a product tag.
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/products/tag/<id>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/products/tag/37 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('products/tag/37', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('products/tags/37')); ?>
+```
+
+```python
+print(wcapi.delete("products/tag/37").json())
+```
+
+```ruby
+woocommerce.delete("products/tag/37").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Deleted product_tag"
+}
+```
+
+
diff --git a/source/includes/v3/_products.md b/source/includes/v3/_products.md
index cd5f6cc9..8424efae 100644
--- a/source/includes/v3/_products.md
+++ b/source/includes/v3/_products.md
@@ -1,6 +1,6 @@
# Products #
-This section lists all API that can be used to create, edit or otherwise manipulate products.
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate products.
## Products Properties ##
@@ -70,6 +70,11 @@ This section lists all API that can be used to create, edit or otherwise manipul
| `parent` | array | List the product parent data when query for a variation read-only |
| `product_url` | string | Product external URL. Only for `external` products write-only |
| `button_text` | string | Product external button text. Only for `external` products write-only |
+| `menu_order` | integer | Menu order, used to custom sort products |
+
+
### Dimensions Properties ###
@@ -88,10 +93,14 @@ This section lists all API that can be used to create, edit or otherwise manipul
| `created_at` | string | UTC DateTime when the image was created read-only |
| `updated_at` | string | UTC DateTime when the image was last updated read-only |
| `src` | string | Image URL. In write-mode you can use to send new images |
-| `title` | string | Image title (attachment title) read-only |
-| `alt` | string | Image alt text (attachment image alt text) read-only |
+| `title` | string | Image title (attachment title) |
+| `alt` | string | Image alt text (attachment image alt text) |
| `position` | integer | Image position. `0` means that the image is featured |
+
+
### Attributes Properties ###
| Attribute | Type | Description |
@@ -155,7 +164,7 @@ This section lists all API that can be used to create, edit or otherwise manipul
| `download_limit` | integer | Amount of times the variation can be downloaded. In write-mode you can sent a blank string for unlimited re-downloads. e.g `''` |
| `download_expiry` | integer | Number of days that the customer has up to be able to download the varition. In write-mode you can sent a blank string for never expiry. e.g `''` |
-## Create A Product ##
+## Create a Product ##
This API helps you to create a new product.
@@ -229,6 +238,36 @@ WooCommerce.post('products', data, function(err, data, res) {
});
```
+```php
+ [
+ 'title' => 'Premium Quality',
+ 'type' => 'simple',
+ 'regular_price' => '21.99',
+ 'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+ 'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+ 'categories' => [
+ 9,
+ 14
+ ],
+ 'images' => [
+ [
+ 'src' => 'http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
+ 'position' => 0
+ ],
+ [
+ 'src' => 'http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg',
+ 'position' => 1
+ ]
+ ]
+ ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+```
+
```python
data = {
"product": {
@@ -378,7 +417,9 @@ woocommerce.post("products", data).parsed_response
"purchase_note": "",
"total_sales": 0,
"variations": [],
- "parent": []
+ "parent": [],
+ "grouped_products": [],
+ "menu_order": 0
}
}
```
@@ -566,6 +607,97 @@ WooCommerce.post('products', data, function(err, data, res) {
});
```
+```php
+ [
+ 'title' => 'Ship Your Idea',
+ 'type' => 'variable',
+ 'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
+ 'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
+ 'categories' => [
+ 9,
+ 14
+ ],
+ 'images' => [
+ [
+ 'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+ 'position' => 0
+ ],
+ [
+ 'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg',
+ 'position' => 1
+ ],
+ [
+ 'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+ 'position' => 2
+ ],
+ [
+ 'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg',
+ 'position' => 3
+ ]
+ ],
+ 'attributes' => [
+ [
+ 'name' => 'Color',
+ 'slug' => 'color',
+ 'position' => '0',
+ 'visible' => false,
+ 'variation' => true,
+ 'options' => [
+ 'Black',
+ 'Green'
+ ]
+ ]
+ ],
+ 'default_attributes' => [
+ [
+ 'name' => 'Color',
+ 'slug' => 'color',
+ 'option' => 'Black'
+ ]
+ ],
+ 'variations' => [
+ [
+ 'regular_price' => '19.99',
+ 'image' => [
+ [
+ 'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
+ 'position' => 0
+ ]
+ ],
+ 'attributes' => [
+ [
+ 'name' => 'Color',
+ 'slug' => 'color',
+ 'option' => 'black'
+ ]
+ ]
+ ],
+ [
+ 'regular_price' => '19.99',
+ 'image' => [
+ [
+ 'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
+ 'position' => 0
+ ]
+ ],
+ 'attributes' => [
+ [
+ 'name' => 'Color',
+ 'slug' => 'color',
+ 'option' => 'green'
+ ]
+ ]
+ ]
+ ]
+ ]
+];
+
+print_r($woocommerce->post('products', $data));
+?>
+```
+
```python
data = {
"product": {
@@ -972,12 +1104,14 @@ woocommerce.post("products", data).parsed_response
"download_expiry": 0
}
],
- "parent": []
+ "parent": [],
+ "grouped_products": [],
+ "menu_order": 0
}
}
```
-## View A Product ##
+## View a Product ##
This API lets you retrieve and view a specific product by ID.
@@ -1001,6 +1135,10 @@ WooCommerce.get('products/546', function(err, data, res) {
});
```
+```php
+get('products/546')); ?>
+```
+
```python
print(wcapi.get("products/546").json())
```
@@ -1102,12 +1240,14 @@ woocommerce.get("products/546").parsed_response
"purchase_note": "",
"total_sales": 0,
"variations": [],
- "parent": []
+ "parent": [],
+ "grouped_products": [],
+ "menu_order": 0
}
}
```
-## View List Of Products ##
+## View List of Products ##
This API helps you to view all the products.
@@ -1131,6 +1271,10 @@ WooCommerce.get('products', function(err, data, res) {
});
```
+```php
+get('products')); ?>
+```
+
```python
print(wcapi.get("products").json())
```
@@ -1233,7 +1377,9 @@ woocommerce.get("products").parsed_response
"purchase_note": "",
"total_sales": 0,
"variations": [],
- "parent": []
+ "parent": [],
+ "grouped_products": [],
+ "menu_order": 0
},
{
"title": "Ship Your Idea",
@@ -1459,7 +1605,9 @@ woocommerce.get("products").parsed_response
"download_expiry": 0
}
],
- "parent": []
+ "parent": [],
+ "grouped_products": [],
+ "menu_order": 0
}
]
}
@@ -1467,13 +1615,20 @@ woocommerce.get("products").parsed_response
#### Available Filters ####
-| Filter | Type | Description |
-| ---------- | ------ | -------------------------------------------- |
-| `type` | string | Products by type. eg: `simple` or `variable` |
-| `category` | string | Products by category. |
-| `sku` | string | Filter a product by SKU. |
+| Filter | Type | Description |
+| ---------------- | ------ | ---------------------------------------------------- |
+| `type` | string | Products by type. eg: `simple` or `variable`. |
+| `category` | string | Products by category. |
+| `tag` | string | Products by tag. |
+| `shipping_class` | string | Products by shipping class. |
+| `pa_*` | string | Products by attributes. eg: `filter[pa_color]=black` |
+| `sku` | string | Filter a product by SKU. |
-## Update A Product ##
+
+
+## Update a Product ##
This API lets you make changes to a product.
@@ -1509,6 +1664,18 @@ WooCommerce.put('products/546', data, function(err, data, res) {
});
```
+```php
+ [
+ 'regular_price' => '24.54'
+ ]
+];
+
+print_r($woocommerce->put('products/546', $data));
+?>
+```
+
```python
data = {
"product": {
@@ -1622,7 +1789,9 @@ woocommerce.put("products/546", data).parsed_response
"purchase_note": "",
"total_sales": 0,
"variations": [],
- "parent": []
+ "parent": [],
+ "grouped_products": [],
+ "menu_order": 0
}
}
```
@@ -1643,7 +1812,7 @@ To update is necessary to send objects containing IDs and to create new not just
```shell
-curl -X PUT https://example.com/wc-api/v3/products/bulk \
+curl -X POST https://example.com/wc-api/v3/products/bulk \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
@@ -1674,29 +1843,57 @@ var data = {
products: [
{
id: 546,
- regular_price: "29.99"
+ regular_price: '29.99'
},
{
id: 604,
variations: [
{
id: 609,
- regular_price: "29.99"
+ regular_price: '29.99'
},
{
id: 611,
- regular_price: "29.99"
+ regular_price: '29.99'
}
]
}
]
};
-WooCommerce.put('products/bulk', data, function(err, data, res) {
+WooCommerce.post('products/bulk', data, function(err, data, res) {
console.log(res);
});
```
+```php
+ [
+ [
+ 'id' => 546,
+ 'regular_price' => '29.99'
+ ],
+ [
+ 'id' => 604,
+ 'variations' => [
+ [
+ 'id' => 609,
+ 'regular_price' => '29.99'
+ ],
+ [
+ 'id' => 611,
+ 'regular_price' => '29.99'
+ ]
+ ]
+ ]
+ ]
+];
+
+print_r($woocommerce->post('products/bulk', $data));
+?>
+```
+
```python
data = {
"products": [
@@ -1720,7 +1917,7 @@ data = {
]
}
-print(wcapi.put("products/bulk", data).json())
+print(wcapi.post("products/bulk", data).json())
```
```ruby
@@ -1746,7 +1943,7 @@ data = {
]
}
-woocommerce.put("products/bulk", data).parsed_response
+woocommerce.post("products/bulk", data).parsed_response
```
> JSON response example:
@@ -1843,7 +2040,9 @@ woocommerce.put("products/bulk", data).parsed_response
"purchase_note": "",
"total_sales": 0,
"variations": [],
- "parent": []
+ "parent": [],
+ "grouped_products": [],
+ "menu_order": 0
},
{
"title": "Ship Your Idea",
@@ -2069,13 +2268,15 @@ woocommerce.put("products/bulk", data).parsed_response
"download_expiry": 0
}
],
- "parent": []
+ "parent": [],
+ "grouped_products": [],
+ "menu_order": 0
}
]
}
```
-## Delete A Product ##
+## Delete a Product ##
This API helps you delete a product.
@@ -2099,6 +2300,10 @@ WooCommerce.delete('products/546?force=true', function(err, data, res) {
});
```
+```php
+delete('products/546', ['force' => true])); ?>
+```
+
```python
print(wcapi.delete("products/546?force=true").json())
```
@@ -2145,6 +2350,10 @@ WooCommerce.get('products/count', function(err, data, res) {
});
```
+```php
+get('products/count')); ?>
+```
+
```python
print(wcapi.get("products/count").json())
```
@@ -2163,509 +2372,20 @@ woocommerce.get("products/count").parsed_response
#### Available Filters ####
-| Filter | Type | Description |
-| ---------- | ------ | -------------------------------------------- |
-| `type` | string | Products by type. eg: `simple` or `variable` |
-| `category` | string | Products by category. |
-
-## Create A Product Attribute ##
-
-This API helps you to create a new product attribute.
-
-### HTTP Request ###
-
-
-
- POST
- /wc-api/v3/products/attributes
-
-
-
-```shell
-curl -X POST https://example.com/wc-api/v3/products/attributes \
- -u consumer_key:consumer_secret \
- -H "Content-Type: application/json" \
- -d '{
- "product_attribute": {
- "name": "Color",
- "slug": "pa_color",
- "type": "select",
- "order_by": "menu_order",
- "has_archives": true
- }
-}'
-```
-
-```javascript
-var data = {
- product_attribute: {
- name: "Color",
- slug: "pa_color",
- type: "select",
- order_by: "menu_order",
- has_archives: true
- }
-};
-
-WooCommerce.post('products/attributes', data, function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-data = {
- "product_attribute": {
- "name": "Color",
- "slug": "pa_color",
- "type": "select",
- "order_by": "menu_order",
- "has_archives": True
- }
-}
-
-print(wcapi.post("products/attributes", data).json())
-```
-
-```ruby
-data = {
- product_attribute: {
- name: "Color",
- slug: "pa_color",
- type: "select",
- order_by: "menu_order",
- has_archives: true
- }
-}
-
-woocommerce.post("products/attributes", data).parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "product_attribute": {
- "id": 1,
- "name": "Color",
- "slug": "pa_color",
- "type": "select",
- "order_by": "menu_order",
- "has_archives": true
- }
-}
-```
-
-### Product Attribute Properties ###
-
-| Attribute | Type | Description |
-| -------------- | ------- | -------------------------------------------------------------------------------------------------------------------- |
-| `id` | integer | Attribute ID read-only |
-| `name` | string | Attribute name |
-| `slug` | string | Attribute slug |
-| `type` | string | Attribute type, the types available include by default are: `select` and `text` (some plugins can include new types) |
-| `order_by` | string | Default sort order. Available: `menu_order`, `name`, `name_num` and `id` |
-| `has_archives` | boolean | Enable/Disable attribute archives |
-
-## View A Product Attribute ##
-
-This API lets you retrieve and view a specific product attribute by ID.
-
-
-
- GET
- /wc-api/v3/products/attributes/<id>
-
-
-
-```shell
-curl https://example.com/wc-api/v3/products/attributes/1 \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.get('products/attributes/1', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.get("products/attributes/1").json())
-```
-
-```ruby
-woocommerce.get("products/attributes/1").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "product_attribute": {
- "id": 1,
- "name": "Color",
- "slug": "pa_color",
- "type": "select",
- "order_by": "menu_order",
- "has_archives": true
- }
-}
-```
-
-
-
-## View List Of Product Attributes ##
-
-This API helps you to view all the product attributes.
-
-### HTTP Request ###
-
-
-
- GET
- /wc-api/v3/products/attributes
-
-
-
-```shell
-curl https://example.com/wc-api/v3/products/attributes \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.get('products/attributes', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.get("products/attributes").json())
-```
-
-```ruby
-woocommerce.get("products/attributes").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "product_attributes": [
- {
- "id": 1,
- "name": "Color",
- "slug": "pa_color",
- "type": "select",
- "order_by": "menu_order",
- "has_archives": true
- },
- {
- "id": 2,
- "name": "Size",
- "slug": "pa_size",
- "type": "select",
- "order_by": "menu_order",
- "has_archives": false
- }
- ]
-}
-```
-
-
-
-## Update A Product Attribute ##
-
-This API lets you make changes to a product attribute.
-
-### HTTP Request ###
-
-
-
- PUT
- /wc-api/v3/products/attributes/<id>
-
-
-
-```shell
-curl -X PUT https://example.com/wc-api/v3/products/attributes/1 \
- -u consumer_key:consumer_secret \
- -H "Content-Type: application/json" \
- -d '{
- "product_attribute": {
- "order_by": "name"
- }
-}'
-```
-
-```javascript
-var data = {
- product_attribute: {
- order_by: 'name'
- }
-};
-
-WooCommerce.put('products/attributes/1', data, function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-data = {
- "product_attribute": {
- "order_by": "name"
- }
-}
-
-print(wcapi.put("products/attributes/1", data).json())
-```
-
-```ruby
-data = {
- product_attribute: {
- order_by: "name"
- }
-}
-
-woocommerce.put("products/attributes/1", data).parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "product_attribute": {
- "id": 1,
- "name": "Color",
- "slug": "pa_color",
- "type": "select",
- "order_by": "name",
- "has_archives": true
- }
-}
-```
-
-
-
-## Delete A Product Attribute ##
-
-This API helps you delete a product attribute.
-
-### HTTP Request ###
-
-
-
- DELETE
- /wc-api/v3/products/attributes/<id>
-
-
-
-```shell
-curl -X DELETE https://example.com/wc-api/v3/products/attributes/1 \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.delete('products/attributes/1', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.delete("products/attributes/1").json())
-```
-
-```ruby
-woocommerce.delete("products/attributes/1").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "message": "Deleted product_attribute"
-}
-```
-
-## View A Product Category ##
-
-This API lets you retrieve a product category.
-
-
-
- GET
- /wc-api/v3/products/categories/<id>
-
-
-
-```shell
-curl https://example.com/wc-api/v3/products/categories/9 \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.get('products/categories/9', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.get("products/categories/9").json())
-```
-
-```ruby
-woocommerce.get("products/categories/9").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "product_category": {
- "id": 9,
- "name": "Clothing",
- "slug": "clothing",
- "parent": 0,
- "description": "",
- "display": "default",
- "image": "",
- "count": 23
- }
-}
-```
-
-### Product Category Properties ###
-
-| Attribute | Type | Description |
-| ------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `id` | integer | Category ID (term ID) read-only |
-| `name` | string | Category name read-only |
-| `slug` | string | Category slug read-only |
-| `parent` | integer | Category parent read-only |
-| `description` | string | Category description read-only |
-| `display` | string | Category archive display type, the types available include: `default`, `products`, `subcategories` and `both` read-only |
-| `image` | string | Category image URL read-only |
-| `count` | boolean | Shows the quantity of products in this category read-only |
-
-
-## View List Of Product Categories ##
-
-This API lets you retrieve all product categories.
-
-
-
- GET
- /wc-api/v3/products/categories
-
-
-
-```shell
-curl https://example.com/wc-api/v3/products/categories \
- -u consumer_key:consumer_secret
-```
-
-```javascript
-WooCommerce.get('products/categories', function(err, data, res) {
- console.log(res);
-});
-```
-
-```python
-print(wcapi.get("products/categories").json())
-```
-
-```ruby
-woocommerce.get("products/categories").parsed_response
-```
-
-> JSON response example:
-
-```json
-{
- "product_categories": [
- {
- "id": 15,
- "name": "Albums",
- "slug": "albums",
- "parent": 11,
- "description": "",
- "display": "default",
- "image": "",
- "count": 4
- },
- {
- "id": 9,
- "name": "Clothing",
- "slug": "clothing",
- "parent": 0,
- "description": "",
- "display": "default",
- "image": "",
- "count": 23
- },
- {
- "id": 10,
- "name": "Hoodies",
- "slug": "hoodies",
- "parent": 9,
- "description": "",
- "display": "default",
- "image": "",
- "count": 6
- },
- {
- "id": 11,
- "name": "Music",
- "slug": "music",
- "parent": 0,
- "description": "",
- "display": "default",
- "image": "",
- "count": 6
- },
- {
- "id": 12,
- "name": "Posters",
- "slug": "posters",
- "parent": 0,
- "description": "",
- "display": "default",
- "image": "",
- "count": 5
- },
- {
- "id": 13,
- "name": "Singles",
- "slug": "singles",
- "parent": 11,
- "description": "",
- "display": "default",
- "image": "",
- "count": 2
- },
- {
- "id": 14,
- "name": "T-shirts",
- "slug": "t-shirts",
- "parent": 9,
- "description": "",
- "display": "default",
- "image": "",
- "count": 17
- }
- ]
-}
-```
+| Filter | Type | Description |
+| ---------------- | ------ | ---------------------------------------------------- |
+| `type` | string | Products by type. eg: `simple` or `variable`. |
+| `category` | string | Products by category. |
+| `tag` | string | Products by tag. |
+| `shipping_class` | string | Products by shipping class. |
+| `pa_*` | string | Products by attributes. eg: `filter[pa_color]=black` |
+| `sku` | string | Filter a product by SKU. |
-## View List Of Product Orders ##
+## View List of Product Orders ##
This API lets you retrieve all product orders.
@@ -2687,6 +2407,10 @@ WooCommerce.get('products/546/orders', function(err, data, res) {
});
```
+```php
+get('products/546/orders')); ?>
+```
+
```python
print(wcapi.get("products/546/orders").json())
```
@@ -3008,7 +2732,7 @@ woocommerce.get("products/546/orders").parsed_response
View the Order Properties for more details on this response.
-## View List Of Product Reviews ##
+## View List of Product Reviews ##
This API lets you retrieve all reviews of a product.
@@ -3030,6 +2754,10 @@ WooCommerce.get('products/546/reviews', function(err, data, res) {
});
```
+```php
+get('products/546/reviews')); ?>
+```
+
```python
print(wcapi.get("products/546/reviews").json())
```
diff --git a/source/includes/v3/_reports.md b/source/includes/v3/_reports.md
index d76a20ad..75cc8b15 100644
--- a/source/includes/v3/_reports.md
+++ b/source/includes/v3/_reports.md
@@ -1,10 +1,10 @@
# Reports #
-This section lists all API that can be used view reports.
+This section lists all API endpoints that can be used view reports.
## Reports Filters ##
-Use the following filters for any type of report to specify the period of sales:
+Use the following filters for any type of report to specify the period of sales:
| Filter | Type | Description |
| ---------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
@@ -12,7 +12,7 @@ Use the following filters for any type of report to specify the period of sales:
| `date_min` | string | Return sales for a specific start date. The date need to be in the `YYYY-MM-AA` format |
| `date_max` | string | Return sales for a specific end date. The dates need to be in the `YYYY-MM-AA` format. Required to set the `filter[date_min]` too |
-## View List Of Reports ##
+## View List of Reports ##
This API lets you retrieve and view a simple list of available reports.
@@ -36,6 +36,10 @@ WooCommerce.get('reports', function(err, data, res) {
});
```
+```php
+get('reports')); ?>
+```
+
```python
print(wcapi.get("reports").json())
```
@@ -55,7 +59,7 @@ woocommerce.get("reports").parsed_response
}
```
-## View List Of Sales Report ##
+## View List of Sales Report ##
This API lets you retrieve and view a list of sales report.
@@ -79,12 +83,32 @@ WooCommerce.get('reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015
});
```
+```php
+ [
+ 'date_min' => '2015-01-18',
+ 'date_max' => '2015-01-21'
+ ]
+];
+
+print_r($woocommerce->get('reports/sales', $query));
+?>
+```
+
```python
print(wcapi.get("reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21").json())
```
```ruby
-woocommerce.get("reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21").parsed_response
+query = {
+ filter: {
+ date_min: "2015-01-18",
+ date_max: "2015-01-21"
+ }
+}
+
+woocommerce.get("reports/sales", query).parsed_response
```
> JSON response example:
@@ -143,7 +167,7 @@ woocommerce.get("reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015
}
```
-## View List Of Top Sellers Report ##
+## View List of Top Sellers Report ##
This API lets you retrieve and view a list of top sellers report.
@@ -167,12 +191,30 @@ WooCommerce.get('reports/sales/top_sellers?filter[period]=last_month', function(
});
```
+```php
+ [
+ 'period' => 'last_month'
+ ]
+];
+
+print_r($woocommerce->get('reports/sales/top_sellers', $query));
+?>
+```
+
```python
print(wcapi.get("reports/sales/top_sellers?filter[period]=last_month").json())
```
```ruby
-woocommerce.get("reports/sales/top_sellers?filter[period]=last_month").parsed_response
+query = {
+ filter: {
+ period: "last_month"
+ }
+}
+
+woocommerce.get("reports/sales/top_sellers", query).parsed_response
```
> JSON response example:
diff --git a/source/includes/v3/_tax-classes.md b/source/includes/v3/_tax-classes.md
new file mode 100644
index 00000000..26d823af
--- /dev/null
+++ b/source/includes/v3/_tax-classes.md
@@ -0,0 +1,254 @@
+# Tax - Classes #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate tax classes.
+
+## Taxes Properties ##
+
+| Attribute | Type | Description |
+| --------- | ------ | -------------------------------------------------------- |
+| `slug` | string | Tax class slug read-only |
+| `name` | string | Tax class name |
+
+## Create a Tax Class ##
+
+This API helps you to create a new tax class.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/taxes/classes
+
+
+
+```shell
+curl -X POST https://example.com/wc-api/v3/taxes/classes \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "tax_class": {
+ "name": "Zero Rate"
+ }
+}'
+```
+
+```javascript
+var data = {
+ tax_class: {
+ name: 'Zero Rate'
+ }
+};
+
+WooCommerce.post('taxes/classes', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'name' => 'Zero Rate'
+ ]
+];
+
+print_r($woocommerce->post('taxes/classes', $data));
+?>
+```
+
+```python
+data = {
+ "tax_class": {
+ "name": "Zero Rate"
+ }
+}
+
+print(wcapi.post("taxes/classes", data).json())
+```
+
+```ruby
+data = {
+ tax_class: {
+ name: "Zero Rate"
+ }
+}
+
+woocommerce.post("taxes/classes", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "tax_class": {
+ "slug": "zero-rate",
+ "name": "Zero Rate"
+ }
+}
+```
+
+
+
+## View List of Tax Classes ##
+
+This API helps you to view all the tax classes.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/taxes/classes
+
+
+
+```shell
+curl https://example.com/wc-api/v3/taxes/classes \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('taxes/classes', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('taxes/classes')); ?>
+```
+
+```python
+print(wcapi.get("taxes/classes").json())
+```
+
+```ruby
+woocommerce.get("taxes/classes").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "tax_classes": [
+ {
+ "slug": "standard",
+ "name": "Standard Rate"
+ },
+ {
+ "slug": "reduced-rate",
+ "name": "Reduced Rate"
+ },
+ {
+ "slug": "zero-rate",
+ "name": "Zero Rate"
+ }
+ ]
+}
+```
+
+
+
+## Delete a Tax Class ##
+
+This API helps you delete a tax class.
+
+
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/taxes/classes/<slug>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/taxes/classes/zero-rate \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('taxes/classes/zero-rate', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('taxes/classes/zero-rate')); ?>
+```
+
+```python
+print(wcapi.delete("taxes/classes/zero-rate").json())
+```
+
+```ruby
+woocommerce.delete("taxes/classes/zero-rate").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Deleted tax_class"
+}
+```
+
+
+
+## View Tax Rate Count ##
+
+This API lets you retrieve a count of all tax rates.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/taxes/classes/count
+
+
+
+```shell
+curl https://example.com/wc-api/v3/taxes/classes/count \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('taxes/classes/count', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('taxes/classes/count')); ?>
+```
+
+```python
+print(wcapi.get("taxes/classes/count").json())
+```
+
+```ruby
+woocommerce.get("taxes/classes/count").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "count": 3
+}
+```
+
+
diff --git a/source/includes/v3/_taxes.md b/source/includes/v3/_taxes.md
new file mode 100644
index 00000000..0bc76c30
--- /dev/null
+++ b/source/includes/v3/_taxes.md
@@ -0,0 +1,3282 @@
+# Taxes #
+
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate tax rates.
+
+## Taxes Properties ##
+
+| Attribute | Type | Description |
+| ---------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| `id` | integer | Tax rate ID read-only |
+| `country` | string | Country 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` | float | 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 | Choose whether or not this is a compound rate. Compound tax rates are applied on top of other tax rates. Default is `false` |
+| `shipping` | boolean | Choose 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 Request ###
+
+
+
+ POST
+ /wc-api/v3/taxes
+
+
+
+```shell
+curl -X POST https://example.com/wc-api/v3/taxes \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "tax": {
+ "country": "US",
+ "state": "AL",
+ "rate": "4",
+ "name": "State Tax",
+ "shipping": false
+ }
+}'
+```
+
+```javascript
+var data = {
+ tax: {
+ country: 'US',
+ state: 'AL',
+ rate: '4',
+ name: 'State Tax',
+ shipping: false
+ }
+};
+
+WooCommerce.post('taxes', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'country' => 'US',
+ 'state' => 'AL',
+ 'rate' => '4',
+ 'name' => 'State Tax',
+ 'shipping' => false
+ ]
+];
+
+print_r($woocommerce->post('taxes', $data));
+?>
+```
+
+```python
+data = {
+ "tax": {
+ "country": "US",
+ "state": "AL",
+ "rate": "4",
+ "name": "State Tax",
+ "shipping": False
+ }
+}
+
+print(wcapi.post("taxes", data).json())
+```
+
+```ruby
+data = {
+ tax: {
+ country: "US",
+ state: "AL",
+ rate: "4",
+ name: "State Tax",
+ shipping: false
+ }
+}
+
+woocommerce.post("taxes", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "tax": {
+ "id": 53,
+ "country": "US",
+ "state": "AL",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 0,
+ "class": "standard"
+ }
+}
+```
+
+
+
+## View a Tax Rate ##
+
+This API lets you retrieve and view a specific tax rate by ID.
+
+
+
+ GET
+ /wc-api/v3/taxes/<id>
+
+
+
+```shell
+curl https://example.com/wc-api/v3/taxes/53 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('taxes/53', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('taxes/53')); ?>
+```
+
+```python
+print(wcapi.get("taxes/53").json())
+```
+
+```ruby
+woocommerce.get("taxes/53").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "tax": {
+ "id": 53,
+ "country": "US",
+ "state": "AL",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 0,
+ "class": "standard"
+ }
+}
+```
+
+
+
+## View List of Tax Rates ##
+
+This API helps you to view all the tax rates.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/taxes
+
+
+
+```shell
+curl https://example.com/wc-api/v3/taxes \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('taxes', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('taxes')); ?>
+```
+
+```python
+print(wcapi.get("taxes").json())
+```
+
+```ruby
+woocommerce.get("taxes").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "taxes": [
+ {
+ "id": 53,
+ "country": "US",
+ "state": "AL",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 1,
+ "class": "standard"
+ },
+ {
+ "id": 54,
+ "country": "US",
+ "state": "AZ",
+ "postcode": "",
+ "city": "",
+ "rate": "5.6000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 2,
+ "class": "standard"
+ },
+ {
+ "id": 55,
+ "country": "US",
+ "state": "AR",
+ "postcode": "",
+ "city": "",
+ "rate": "6.5000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 3,
+ "class": "standard"
+ },
+ {
+ "id": 56,
+ "country": "US",
+ "state": "CA",
+ "postcode": "",
+ "city": "",
+ "rate": "7.5000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 4,
+ "class": "standard"
+ },
+ {
+ "id": 57,
+ "country": "US",
+ "state": "CO",
+ "postcode": "",
+ "city": "",
+ "rate": "2.9000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 5,
+ "class": "standard"
+ },
+ {
+ "id": 58,
+ "country": "US",
+ "state": "CT",
+ "postcode": "",
+ "city": "",
+ "rate": "6.3500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 6,
+ "class": "standard"
+ },
+ {
+ "id": 59,
+ "country": "US",
+ "state": "DC",
+ "postcode": "",
+ "city": "",
+ "rate": "5.7500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 7,
+ "class": "standard"
+ },
+ {
+ "id": 60,
+ "country": "US",
+ "state": "FL",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 8,
+ "class": "standard"
+ },
+ {
+ "id": 61,
+ "country": "US",
+ "state": "GA",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 9,
+ "class": "standard"
+ },
+ {
+ "id": 62,
+ "country": "US",
+ "state": "GU",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 10,
+ "class": "standard"
+ },
+ {
+ "id": 63,
+ "country": "US",
+ "state": "HI",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 11,
+ "class": "standard"
+ },
+ {
+ "id": 64,
+ "country": "US",
+ "state": "ID",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 12,
+ "class": "standard"
+ }
+ ]
+}
+```
+
+#### Available Filters ####
+
+| Filter | Type | Description |
+| ---------------- | ------ | ----------------------------------------------------------------- |
+| `tax_rate_class` | string | Tax rates by class. eg: `standard`, `reduced-rate` or `zero-rate` |
+
+
+
+## Update a Tax Rate ##
+
+This API lets you make changes to a tax rate.
+
+### HTTP Request ###
+
+
+
+ PUT
+ /wc-api/v3/taxes/<id>
+
+
+
+```shell
+curl -X PUT https://example.com/wc-api/v3/taxes/53 \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "tax": {
+ "name": "US Tax"
+ }
+}'
+```
+
+```javascript
+var data = {
+ tax: {
+ name: 'US Tax'
+ }
+};
+
+WooCommerce.put('taxes/53', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ 'name' => 'US Tax'
+ ]
+];
+
+print_r($woocommerce->put('taxes/53', $data));
+?>
+```
+
+```python
+data = {
+ "tax": {
+ "name": "US Tax"
+ }
+}
+
+print(wcapi.put("taxes/53", data).json())
+```
+
+```ruby
+data = {
+ tax: {
+ name: "US Tax"
+ }
+}
+
+woocommerce.put("taxes/53", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "tax": {
+ "id": 53,
+ "country": "US",
+ "state": "AL",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "US Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 0,
+ "class": "standard"
+ }
+}
+```
+
+
+
+## Create/Update Multiple Tax Rates ##
+
+This API helps you to bulk create/update multiple tax rates.
+
+To update is necessary to send objects containing IDs and to create new not just send the ID.
+
+### HTTP Request ###
+
+
+
+ POST
+ /wc-api/v3/taxes/bulk
+
+
+
+> Example bulk creating all US taxes:
+
+```shell
+curl -X POST https://example.com/wc-api/v3/taxes/bulk \
+ -u consumer_key:consumer_secret \
+ -H "Content-Type: application/json" \
+ -d '{
+ "taxes": [
+ {
+ "country": "US",
+ "state": "AL",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 1
+ },
+ {
+ "country": "US",
+ "state": "AZ",
+ "rate": "5.6000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 2
+ },
+ {
+ "country": "US",
+ "state": "AR",
+ "rate": "6.5000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 3
+ },
+ {
+ "country": "US",
+ "state": "CA",
+ "rate": "7.5000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 4
+ },
+ {
+ "country": "US",
+ "state": "CO",
+ "rate": "2.9000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 5
+ },
+ {
+ "country": "US",
+ "state": "CT",
+ "rate": "6.3500",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 6
+ },
+ {
+ "country": "US",
+ "state": "DC",
+ "rate": "5.7500",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 7
+ },
+ {
+ "country": "US",
+ "state": "FL",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 8
+ },
+ {
+ "country": "US",
+ "state": "GA",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 9
+ },
+ {
+ "country": "US",
+ "state": "GU",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 10
+ },
+ {
+ "country": "US",
+ "state": "HI",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 11
+ },
+ {
+ "country": "US",
+ "state": "ID",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 12
+ },
+ {
+ "country": "US",
+ "state": "IL",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 13
+ },
+ {
+ "country": "US",
+ "state": "IN",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 14
+ },
+ {
+ "country": "US",
+ "state": "IA",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 15
+ },
+ {
+ "country": "US",
+ "state": "KS",
+ "rate": "6.1500",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 16
+ },
+ {
+ "country": "US",
+ "state": "KY",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 17
+ },
+ {
+ "country": "US",
+ "state": "LA",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 18
+ },
+ {
+ "country": "US",
+ "state": "ME",
+ "rate": "5.5000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 19
+ },
+ {
+ "country": "US",
+ "state": "MD",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 20
+ },
+ {
+ "country": "US",
+ "state": "MA",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 21
+ },
+ {
+ "country": "US",
+ "state": "MI",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 22
+ },
+ {
+ "country": "US",
+ "state": "MN",
+ "rate": "6.8750",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 23
+ },
+ {
+ "country": "US",
+ "state": "MS",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 24
+ },
+ {
+ "country": "US",
+ "state": "MO",
+ "rate": "4.2250",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 25
+ },
+ {
+ "country": "US",
+ "state": "NE",
+ "rate": "5.5000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 26
+ },
+ {
+ "country": "US",
+ "state": "NV",
+ "rate": "6.8500",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 27
+ },
+ {
+ "country": "US",
+ "state": "NJ",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 28
+ },
+ {
+ "country": "US",
+ "state": "NM",
+ "rate": "5.1250",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 29
+ },
+ {
+ "country": "US",
+ "state": "NY",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 30
+ },
+ {
+ "country": "US",
+ "state": "NC",
+ "rate": "4.7500",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 31
+ },
+ {
+ "country": "US",
+ "state": "ND",
+ "rate": "5.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 32
+ },
+ {
+ "country": "US",
+ "state": "OH",
+ "rate": "5.7500",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 33
+ },
+ {
+ "country": "US",
+ "state": "OK",
+ "rate": "4.5000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 34
+ },
+ {
+ "country": "US",
+ "state": "PA",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 35
+ },
+ {
+ "country": "US",
+ "state": "PR",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 36
+ },
+ {
+ "country": "US",
+ "state": "RI",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 37
+ },
+ {
+ "country": "US",
+ "state": "SC",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 38
+ },
+ {
+ "country": "US",
+ "state": "SD",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 39
+ },
+ {
+ "country": "US",
+ "state": "TN",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 40
+ },
+ {
+ "country": "US",
+ "state": "TX",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 41
+ },
+ {
+ "country": "US",
+ "state": "UT",
+ "rate": "5.9500",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 42
+ },
+ {
+ "country": "US",
+ "state": "VT",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 43
+ },
+ {
+ "country": "US",
+ "state": "VA",
+ "rate": "5.3000",
+ "name": "State Tax",
+ "shipping": false,
+ "order": 44
+ },
+ {
+ "country": "US",
+ "state": "WA",
+ "rate": "6.5000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 45
+ },
+ {
+ "country": "US",
+ "state": "WV",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 46
+ },
+ {
+ "country": "US",
+ "state": "WI",
+ "rate": "5.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 47
+ },
+ {
+ "country": "US",
+ "state": "WY",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": true,
+ "order": 48
+ }
+ ]
+}'
+```
+
+```javascript
+var data = {
+ taxes: [
+ {
+ country: 'US',
+ state: 'AL',
+ rate: '4.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 1
+ },
+ {
+ country: 'US',
+ state: 'AZ',
+ rate: '5.6000',
+ name: 'State Tax',
+ shipping: false,
+ order: 2
+ },
+ {
+ country: 'US',
+ state: 'AR',
+ rate: '6.5000',
+ name: 'State Tax',
+ shipping: true,
+ order: 3
+ },
+ {
+ country: 'US',
+ state: 'CA',
+ rate: '7.5000',
+ name: 'State Tax',
+ shipping: false,
+ order: 4
+ },
+ {
+ country: 'US',
+ state: 'CO',
+ rate: '2.9000',
+ name: 'State Tax',
+ shipping: false,
+ order: 5
+ },
+ {
+ country: 'US',
+ state: 'CT',
+ rate: '6.3500',
+ name: 'State Tax',
+ shipping: true,
+ order: 6
+ },
+ {
+ country: 'US',
+ state: 'DC',
+ rate: '5.7500',
+ name: 'State Tax',
+ shipping: true,
+ order: 7
+ },
+ {
+ country: 'US',
+ state: 'FL',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 8
+ },
+ {
+ country: 'US',
+ state: 'GA',
+ rate: '4.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 9
+ },
+ {
+ country: 'US',
+ state: 'GU',
+ rate: '4.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 10
+ },
+ {
+ country: 'US',
+ state: 'HI',
+ rate: '4.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 11
+ },
+ {
+ country: 'US',
+ state: 'ID',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 12
+ },
+ {
+ country: 'US',
+ state: 'IL',
+ rate: '6.2500',
+ name: 'State Tax',
+ shipping: false,
+ order: 13
+ },
+ {
+ country: 'US',
+ state: 'IN',
+ rate: '7.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 14
+ },
+ {
+ country: 'US',
+ state: 'IA',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 15
+ },
+ {
+ country: 'US',
+ state: 'KS',
+ rate: '6.1500',
+ name: 'State Tax',
+ shipping: true,
+ order: 16
+ },
+ {
+ country: 'US',
+ state: 'KY',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 17
+ },
+ {
+ country: 'US',
+ state: 'LA',
+ rate: '4.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 18
+ },
+ {
+ country: 'US',
+ state: 'ME',
+ rate: '5.5000',
+ name: 'State Tax',
+ shipping: false,
+ order: 19
+ },
+ {
+ country: 'US',
+ state: 'MD',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 20
+ },
+ {
+ country: 'US',
+ state: 'MA',
+ rate: '6.2500',
+ name: 'State Tax',
+ shipping: false,
+ order: 21
+ },
+ {
+ country: 'US',
+ state: 'MI',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 22
+ },
+ {
+ country: 'US',
+ state: 'MN',
+ rate: '6.8750',
+ name: 'State Tax',
+ shipping: true,
+ order: 23
+ },
+ {
+ country: 'US',
+ state: 'MS',
+ rate: '7.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 24
+ },
+ {
+ country: 'US',
+ state: 'MO',
+ rate: '4.2250',
+ name: 'State Tax',
+ shipping: false,
+ order: 25
+ },
+ {
+ country: 'US',
+ state: 'NE',
+ rate: '5.5000',
+ name: 'State Tax',
+ shipping: true,
+ order: 26
+ },
+ {
+ country: 'US',
+ state: 'NV',
+ rate: '6.8500',
+ name: 'State Tax',
+ shipping: false,
+ order: 27
+ },
+ {
+ country: 'US',
+ state: 'NJ',
+ rate: '7.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 28
+ },
+ {
+ country: 'US',
+ state: 'NM',
+ rate: '5.1250',
+ name: 'State Tax',
+ shipping: true,
+ order: 29
+ },
+ {
+ country: 'US',
+ state: 'NY',
+ rate: '4.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 30
+ },
+ {
+ country: 'US',
+ state: 'NC',
+ rate: '4.7500',
+ name: 'State Tax',
+ shipping: true,
+ order: 31
+ },
+ {
+ country: 'US',
+ state: 'ND',
+ rate: '5.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 32
+ },
+ {
+ country: 'US',
+ state: 'OH',
+ rate: '5.7500',
+ name: 'State Tax',
+ shipping: true,
+ order: 33
+ },
+ {
+ country: 'US',
+ state: 'OK',
+ rate: '4.5000',
+ name: 'State Tax',
+ shipping: false,
+ order: 34
+ },
+ {
+ country: 'US',
+ state: 'PA',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 35
+ },
+ {
+ country: 'US',
+ state: 'PR',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 36
+ },
+ {
+ country: 'US',
+ state: 'RI',
+ rate: '7.0000',
+ name: 'State Tax',
+ shipping: false,
+ order: 37
+ },
+ {
+ country: 'US',
+ state: 'SC',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 38
+ },
+ {
+ country: 'US',
+ state: 'SD',
+ rate: '4.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 39
+ },
+ {
+ country: 'US',
+ state: 'TN',
+ rate: '7.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 40
+ },
+ {
+ country: 'US',
+ state: 'TX',
+ rate: '6.2500',
+ name: 'State Tax',
+ shipping: true,
+ order: 41
+ },
+ {
+ country: 'US',
+ state: 'UT',
+ rate: '5.9500',
+ name: 'State Tax',
+ shipping: false,
+ order: 42
+ },
+ {
+ country: 'US',
+ state: 'VT',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 43
+ },
+ {
+ country: 'US',
+ state: 'VA',
+ rate: '5.3000',
+ name: 'State Tax',
+ shipping: false,
+ order: 44
+ },
+ {
+ country: 'US',
+ state: 'WA',
+ rate: '6.5000',
+ name: 'State Tax',
+ shipping: true,
+ order: 45
+ },
+ {
+ country: 'US',
+ state: 'WV',
+ rate: '6.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 46
+ },
+ {
+ country: 'US',
+ state: 'WI',
+ rate: '5.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 47
+ },
+ {
+ country: 'US',
+ state: 'WY',
+ rate: '4.0000',
+ name: 'State Tax',
+ shipping: true,
+ order: 48
+ }
+ ]
+};
+
+WooCommerce.post('taxes/bulk', data, function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+ [
+ [
+ 'country' => 'US',
+ 'state' => 'AL',
+ 'rate' => '4.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 1
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'AZ',
+ 'rate' => '5.6000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 2
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'AR',
+ 'rate' => '6.5000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 3
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'CA',
+ 'rate' => '7.5000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 4
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'CO',
+ 'rate' => '2.9000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 5
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'CT',
+ 'rate' => '6.3500',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 6
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'DC',
+ 'rate' => '5.7500',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 7
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'FL',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 8
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'GA',
+ 'rate' => '4.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 9
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'GU',
+ 'rate' => '4.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 10
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'HI',
+ 'rate' => '4.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 11
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'ID',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 12
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'IL',
+ 'rate' => '6.2500',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 13
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'IN',
+ 'rate' => '7.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 14
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'IA',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 15
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'KS',
+ 'rate' => '6.1500',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 16
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'KY',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 17
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'LA',
+ 'rate' => '4.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 18
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'ME',
+ 'rate' => '5.5000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 19
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'MD',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 20
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'MA',
+ 'rate' => '6.2500',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 21
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'MI',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 22
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'MN',
+ 'rate' => '6.8750',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 23
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'MS',
+ 'rate' => '7.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 24
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'MO',
+ 'rate' => '4.2250',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 25
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'NE',
+ 'rate' => '5.5000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 26
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'NV',
+ 'rate' => '6.8500',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 27
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'NJ',
+ 'rate' => '7.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 28
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'NM',
+ 'rate' => '5.1250',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 29
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'NY',
+ 'rate' => '4.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 30
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'NC',
+ 'rate' => '4.7500',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 31
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'ND',
+ 'rate' => '5.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 32
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'OH',
+ 'rate' => '5.7500',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 33
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'OK',
+ 'rate' => '4.5000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 34
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'PA',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 35
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'PR',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 36
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'RI',
+ 'rate' => '7.0000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 37
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'SC',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 38
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'SD',
+ 'rate' => '4.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 39
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'TN',
+ 'rate' => '7.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 40
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'TX',
+ 'rate' => '6.2500',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 41
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'UT',
+ 'rate' => '5.9500',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 42
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'VT',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 43
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'VA',
+ 'rate' => '5.3000',
+ 'name' => 'State Tax',
+ 'shipping' => false,
+ 'order' => 44
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'WA',
+ 'rate' => '6.5000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 45
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'WV',
+ 'rate' => '6.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 46
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'WI',
+ 'rate' => '5.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 47
+ ],
+ [
+ 'country' => 'US',
+ 'state' => 'WY',
+ 'rate' => '4.0000',
+ 'name' => 'State Tax',
+ 'shipping' => true,
+ 'order' => 48
+ ]
+ ]
+];
+
+print_r($woocommerce->post('taxes/bulk', $data));
+?>
+```
+
+```python
+data = {
+ "taxes": [
+ {
+ "country": "US",
+ "state": "AL",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 1
+ },
+ {
+ "country": "US",
+ "state": "AZ",
+ "rate": "5.6000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 2
+ },
+ {
+ "country": "US",
+ "state": "AR",
+ "rate": "6.5000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 3
+ },
+ {
+ "country": "US",
+ "state": "CA",
+ "rate": "7.5000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 4
+ },
+ {
+ "country": "US",
+ "state": "CO",
+ "rate": "2.9000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 5
+ },
+ {
+ "country": "US",
+ "state": "CT",
+ "rate": "6.3500",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 6
+ },
+ {
+ "country": "US",
+ "state": "DC",
+ "rate": "5.7500",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 7
+ },
+ {
+ "country": "US",
+ "state": "FL",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 8
+ },
+ {
+ "country": "US",
+ "state": "GA",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 9
+ },
+ {
+ "country": "US",
+ "state": "GU",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 10
+ },
+ {
+ "country": "US",
+ "state": "HI",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 11
+ },
+ {
+ "country": "US",
+ "state": "ID",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 12
+ },
+ {
+ "country": "US",
+ "state": "IL",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 13
+ },
+ {
+ "country": "US",
+ "state": "IN",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 14
+ },
+ {
+ "country": "US",
+ "state": "IA",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 15
+ },
+ {
+ "country": "US",
+ "state": "KS",
+ "rate": "6.1500",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 16
+ },
+ {
+ "country": "US",
+ "state": "KY",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 17
+ },
+ {
+ "country": "US",
+ "state": "LA",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 18
+ },
+ {
+ "country": "US",
+ "state": "ME",
+ "rate": "5.5000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 19
+ },
+ {
+ "country": "US",
+ "state": "MD",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 20
+ },
+ {
+ "country": "US",
+ "state": "MA",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 21
+ },
+ {
+ "country": "US",
+ "state": "MI",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 22
+ },
+ {
+ "country": "US",
+ "state": "MN",
+ "rate": "6.8750",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 23
+ },
+ {
+ "country": "US",
+ "state": "MS",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 24
+ },
+ {
+ "country": "US",
+ "state": "MO",
+ "rate": "4.2250",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 25
+ },
+ {
+ "country": "US",
+ "state": "NE",
+ "rate": "5.5000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 26
+ },
+ {
+ "country": "US",
+ "state": "NV",
+ "rate": "6.8500",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 27
+ },
+ {
+ "country": "US",
+ "state": "NJ",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 28
+ },
+ {
+ "country": "US",
+ "state": "NM",
+ "rate": "5.1250",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 29
+ },
+ {
+ "country": "US",
+ "state": "NY",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 30
+ },
+ {
+ "country": "US",
+ "state": "NC",
+ "rate": "4.7500",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 31
+ },
+ {
+ "country": "US",
+ "state": "ND",
+ "rate": "5.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 32
+ },
+ {
+ "country": "US",
+ "state": "OH",
+ "rate": "5.7500",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 33
+ },
+ {
+ "country": "US",
+ "state": "OK",
+ "rate": "4.5000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 34
+ },
+ {
+ "country": "US",
+ "state": "PA",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 35
+ },
+ {
+ "country": "US",
+ "state": "PR",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 36
+ },
+ {
+ "country": "US",
+ "state": "RI",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 37
+ },
+ {
+ "country": "US",
+ "state": "SC",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 38
+ },
+ {
+ "country": "US",
+ "state": "SD",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 39
+ },
+ {
+ "country": "US",
+ "state": "TN",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 40
+ },
+ {
+ "country": "US",
+ "state": "TX",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 41
+ },
+ {
+ "country": "US",
+ "state": "UT",
+ "rate": "5.9500",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 42
+ },
+ {
+ "country": "US",
+ "state": "VT",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 43
+ },
+ {
+ "country": "US",
+ "state": "VA",
+ "rate": "5.3000",
+ "name": "State Tax",
+ "shipping": False,
+ "order": 44
+ },
+ {
+ "country": "US",
+ "state": "WA",
+ "rate": "6.5000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 45
+ },
+ {
+ "country": "US",
+ "state": "WV",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 46
+ },
+ {
+ "country": "US",
+ "state": "WI",
+ "rate": "5.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 47
+ },
+ {
+ "country": "US",
+ "state": "WY",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "shipping": True,
+ "order": 48
+ }
+ ]
+}
+
+print(wcapi.post("taxes/bulk", data).json())
+```
+
+```ruby
+data = {
+ taxes: [
+ {
+ country: "US",
+ state: "AL",
+ rate: "4.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 1
+ },
+ {
+ country: "US",
+ state: "AZ",
+ rate: "5.6000",
+ name: "State Tax",
+ shipping: false,
+ order: 2
+ },
+ {
+ country: "US",
+ state: "AR",
+ rate: "6.5000",
+ name: "State Tax",
+ shipping: true,
+ order: 3
+ },
+ {
+ country: "US",
+ state: "CA",
+ rate: "7.5000",
+ name: "State Tax",
+ shipping: false,
+ order: 4
+ },
+ {
+ country: "US",
+ state: "CO",
+ rate: "2.9000",
+ name: "State Tax",
+ shipping: false,
+ order: 5
+ },
+ {
+ country: "US",
+ state: "CT",
+ rate: "6.3500",
+ name: "State Tax",
+ shipping: true,
+ order: 6
+ },
+ {
+ country: "US",
+ state: "DC",
+ rate: "5.7500",
+ name: "State Tax",
+ shipping: true,
+ order: 7
+ },
+ {
+ country: "US",
+ state: "FL",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 8
+ },
+ {
+ country: "US",
+ state: "GA",
+ rate: "4.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 9
+ },
+ {
+ country: "US",
+ state: "GU",
+ rate: "4.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 10
+ },
+ {
+ country: "US",
+ state: "HI",
+ rate: "4.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 11
+ },
+ {
+ country: "US",
+ state: "ID",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 12
+ },
+ {
+ country: "US",
+ state: "IL",
+ rate: "6.2500",
+ name: "State Tax",
+ shipping: false,
+ order: 13
+ },
+ {
+ country: "US",
+ state: "IN",
+ rate: "7.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 14
+ },
+ {
+ country: "US",
+ state: "IA",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 15
+ },
+ {
+ country: "US",
+ state: "KS",
+ rate: "6.1500",
+ name: "State Tax",
+ shipping: true,
+ order: 16
+ },
+ {
+ country: "US",
+ state: "KY",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 17
+ },
+ {
+ country: "US",
+ state: "LA",
+ rate: "4.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 18
+ },
+ {
+ country: "US",
+ state: "ME",
+ rate: "5.5000",
+ name: "State Tax",
+ shipping: false,
+ order: 19
+ },
+ {
+ country: "US",
+ state: "MD",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 20
+ },
+ {
+ country: "US",
+ state: "MA",
+ rate: "6.2500",
+ name: "State Tax",
+ shipping: false,
+ order: 21
+ },
+ {
+ country: "US",
+ state: "MI",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 22
+ },
+ {
+ country: "US",
+ state: "MN",
+ rate: "6.8750",
+ name: "State Tax",
+ shipping: true,
+ order: 23
+ },
+ {
+ country: "US",
+ state: "MS",
+ rate: "7.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 24
+ },
+ {
+ country: "US",
+ state: "MO",
+ rate: "4.2250",
+ name: "State Tax",
+ shipping: false,
+ order: 25
+ },
+ {
+ country: "US",
+ state: "NE",
+ rate: "5.5000",
+ name: "State Tax",
+ shipping: true,
+ order: 26
+ },
+ {
+ country: "US",
+ state: "NV",
+ rate: "6.8500",
+ name: "State Tax",
+ shipping: false,
+ order: 27
+ },
+ {
+ country: "US",
+ state: "NJ",
+ rate: "7.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 28
+ },
+ {
+ country: "US",
+ state: "NM",
+ rate: "5.1250",
+ name: "State Tax",
+ shipping: true,
+ order: 29
+ },
+ {
+ country: "US",
+ state: "NY",
+ rate: "4.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 30
+ },
+ {
+ country: "US",
+ state: "NC",
+ rate: "4.7500",
+ name: "State Tax",
+ shipping: true,
+ order: 31
+ },
+ {
+ country: "US",
+ state: "ND",
+ rate: "5.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 32
+ },
+ {
+ country: "US",
+ state: "OH",
+ rate: "5.7500",
+ name: "State Tax",
+ shipping: true,
+ order: 33
+ },
+ {
+ country: "US",
+ state: "OK",
+ rate: "4.5000",
+ name: "State Tax",
+ shipping: false,
+ order: 34
+ },
+ {
+ country: "US",
+ state: "PA",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 35
+ },
+ {
+ country: "US",
+ state: "PR",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 36
+ },
+ {
+ country: "US",
+ state: "RI",
+ rate: "7.0000",
+ name: "State Tax",
+ shipping: false,
+ order: 37
+ },
+ {
+ country: "US",
+ state: "SC",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 38
+ },
+ {
+ country: "US",
+ state: "SD",
+ rate: "4.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 39
+ },
+ {
+ country: "US",
+ state: "TN",
+ rate: "7.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 40
+ },
+ {
+ country: "US",
+ state: "TX",
+ rate: "6.2500",
+ name: "State Tax",
+ shipping: true,
+ order: 41
+ },
+ {
+ country: "US",
+ state: "UT",
+ rate: "5.9500",
+ name: "State Tax",
+ shipping: false,
+ order: 42
+ },
+ {
+ country: "US",
+ state: "VT",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 43
+ },
+ {
+ country: "US",
+ state: "VA",
+ rate: "5.3000",
+ name: "State Tax",
+ shipping: false,
+ order: 44
+ },
+ {
+ country: "US",
+ state: "WA",
+ rate: "6.5000",
+ name: "State Tax",
+ shipping: true,
+ order: 45
+ },
+ {
+ country: "US",
+ state: "WV",
+ rate: "6.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 46
+ },
+ {
+ country: "US",
+ state: "WI",
+ rate: "5.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 47
+ },
+ {
+ country: "US",
+ state: "WY",
+ rate: "4.0000",
+ name: "State Tax",
+ shipping: true,
+ order: 48
+ }
+ ]
+}
+
+woocommerce.post("taxes/bulk", data).parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "taxes": [
+ {
+ "id": 53,
+ "country": "US",
+ "state": "AL",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 1,
+ "class": "standard"
+ },
+ {
+ "id": 54,
+ "country": "US",
+ "state": "AZ",
+ "postcode": "",
+ "city": "",
+ "rate": "5.6000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 2,
+ "class": "standard"
+ },
+ {
+ "id": 55,
+ "country": "US",
+ "state": "AR",
+ "postcode": "",
+ "city": "",
+ "rate": "6.5000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 3,
+ "class": "standard"
+ },
+ {
+ "id": 56,
+ "country": "US",
+ "state": "CA",
+ "postcode": "",
+ "city": "",
+ "rate": "7.5000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 4,
+ "class": "standard"
+ },
+ {
+ "id": 57,
+ "country": "US",
+ "state": "CO",
+ "postcode": "",
+ "city": "",
+ "rate": "2.9000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 5,
+ "class": "standard"
+ },
+ {
+ "id": 58,
+ "country": "US",
+ "state": "CT",
+ "postcode": "",
+ "city": "",
+ "rate": "6.3500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 6,
+ "class": "standard"
+ },
+ {
+ "id": 59,
+ "country": "US",
+ "state": "DC",
+ "postcode": "",
+ "city": "",
+ "rate": "5.7500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 7,
+ "class": "standard"
+ },
+ {
+ "id": 60,
+ "country": "US",
+ "state": "FL",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 8,
+ "class": "standard"
+ },
+ {
+ "id": 61,
+ "country": "US",
+ "state": "GA",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 9,
+ "class": "standard"
+ },
+ {
+ "id": 62,
+ "country": "US",
+ "state": "GU",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 10,
+ "class": "standard"
+ },
+ {
+ "id": 63,
+ "country": "US",
+ "state": "HI",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 11,
+ "class": "standard"
+ },
+ {
+ "id": 64,
+ "country": "US",
+ "state": "ID",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 12,
+ "class": "standard"
+ },
+ {
+ "id": 65,
+ "country": "US",
+ "state": "IL",
+ "postcode": "",
+ "city": "",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 13,
+ "class": "standard"
+ },
+ {
+ "id": 66,
+ "country": "US",
+ "state": "IN",
+ "postcode": "",
+ "city": "",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 14,
+ "class": "standard"
+ },
+ {
+ "id": 67,
+ "country": "US",
+ "state": "IA",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 15,
+ "class": "standard"
+ },
+ {
+ "id": 68,
+ "country": "US",
+ "state": "KS",
+ "postcode": "",
+ "city": "",
+ "rate": "6.1500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 16,
+ "class": "standard"
+ },
+ {
+ "id": 69,
+ "country": "US",
+ "state": "KY",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 17,
+ "class": "standard"
+ },
+ {
+ "id": 70,
+ "country": "US",
+ "state": "LA",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 18,
+ "class": "standard"
+ },
+ {
+ "id": 71,
+ "country": "US",
+ "state": "ME",
+ "postcode": "",
+ "city": "",
+ "rate": "5.5000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 19,
+ "class": "standard"
+ },
+ {
+ "id": 72,
+ "country": "US",
+ "state": "MD",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 20,
+ "class": "standard"
+ },
+ {
+ "id": 73,
+ "country": "US",
+ "state": "MA",
+ "postcode": "",
+ "city": "",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 21,
+ "class": "standard"
+ },
+ {
+ "id": 74,
+ "country": "US",
+ "state": "MI",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 22,
+ "class": "standard"
+ },
+ {
+ "id": 75,
+ "country": "US",
+ "state": "MN",
+ "postcode": "",
+ "city": "",
+ "rate": "6.8750",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 23,
+ "class": "standard"
+ },
+ {
+ "id": 76,
+ "country": "US",
+ "state": "MS",
+ "postcode": "",
+ "city": "",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 24,
+ "class": "standard"
+ },
+ {
+ "id": 77,
+ "country": "US",
+ "state": "MO",
+ "postcode": "",
+ "city": "",
+ "rate": "4.2250",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 25,
+ "class": "standard"
+ },
+ {
+ "id": 78,
+ "country": "US",
+ "state": "NE",
+ "postcode": "",
+ "city": "",
+ "rate": "5.5000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 26,
+ "class": "standard"
+ },
+ {
+ "id": 79,
+ "country": "US",
+ "state": "NV",
+ "postcode": "",
+ "city": "",
+ "rate": "6.8500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 27,
+ "class": "standard"
+ },
+ {
+ "id": 80,
+ "country": "US",
+ "state": "NJ",
+ "postcode": "",
+ "city": "",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 28,
+ "class": "standard"
+ },
+ {
+ "id": 81,
+ "country": "US",
+ "state": "NM",
+ "postcode": "",
+ "city": "",
+ "rate": "5.1250",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 29,
+ "class": "standard"
+ },
+ {
+ "id": 82,
+ "country": "US",
+ "state": "NY",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 30,
+ "class": "standard"
+ },
+ {
+ "id": 83,
+ "country": "US",
+ "state": "NC",
+ "postcode": "",
+ "city": "",
+ "rate": "4.7500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 31,
+ "class": "standard"
+ },
+ {
+ "id": 84,
+ "country": "US",
+ "state": "ND",
+ "postcode": "",
+ "city": "",
+ "rate": "5.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 32,
+ "class": "standard"
+ },
+ {
+ "id": 85,
+ "country": "US",
+ "state": "OH",
+ "postcode": "",
+ "city": "",
+ "rate": "5.7500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 33,
+ "class": "standard"
+ },
+ {
+ "id": 86,
+ "country": "US",
+ "state": "OK",
+ "postcode": "",
+ "city": "",
+ "rate": "4.5000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 34,
+ "class": "standard"
+ },
+ {
+ "id": 87,
+ "country": "US",
+ "state": "PA",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 35,
+ "class": "standard"
+ },
+ {
+ "id": 88,
+ "country": "US",
+ "state": "PR",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 36,
+ "class": "standard"
+ },
+ {
+ "id": 89,
+ "country": "US",
+ "state": "RI",
+ "postcode": "",
+ "city": "",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 37,
+ "class": "standard"
+ },
+ {
+ "id": 90,
+ "country": "US",
+ "state": "SC",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 38,
+ "class": "standard"
+ },
+ {
+ "id": 91,
+ "country": "US",
+ "state": "SD",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 39,
+ "class": "standard"
+ },
+ {
+ "id": 92,
+ "country": "US",
+ "state": "TN",
+ "postcode": "",
+ "city": "",
+ "rate": "7.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 40,
+ "class": "standard"
+ },
+ {
+ "id": 93,
+ "country": "US",
+ "state": "TX",
+ "postcode": "",
+ "city": "",
+ "rate": "6.2500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 41,
+ "class": "standard"
+ },
+ {
+ "id": 94,
+ "country": "US",
+ "state": "UT",
+ "postcode": "",
+ "city": "",
+ "rate": "5.9500",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 42,
+ "class": "standard"
+ },
+ {
+ "id": 95,
+ "country": "US",
+ "state": "VT",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 43,
+ "class": "standard"
+ },
+ {
+ "id": 96,
+ "country": "US",
+ "state": "VA",
+ "postcode": "",
+ "city": "",
+ "rate": "5.3000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": false,
+ "order": 44,
+ "class": "standard"
+ },
+ {
+ "id": 97,
+ "country": "US",
+ "state": "WA",
+ "postcode": "",
+ "city": "",
+ "rate": "6.5000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 45,
+ "class": "standard"
+ },
+ {
+ "id": 98,
+ "country": "US",
+ "state": "WV",
+ "postcode": "",
+ "city": "",
+ "rate": "6.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 46,
+ "class": "standard"
+ },
+ {
+ "id": 99,
+ "country": "US",
+ "state": "WI",
+ "postcode": "",
+ "city": "",
+ "rate": "5.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 47,
+ "class": "standard"
+ },
+ {
+ "id": 100,
+ "country": "US",
+ "state": "WY",
+ "postcode": "",
+ "city": "",
+ "rate": "4.0000",
+ "name": "State Tax",
+ "priority": 1,
+ "compound": false,
+ "shipping": true,
+ "order": 48,
+ "class": "standard"
+ }
+ ]
+}
+```
+
+
+
+## Delete a Tax Rate ##
+
+This API helps you delete a tax rate.
+
+### HTTP Request ###
+
+
+
+ DELETE
+ /wc-api/v3/taxes/<id>
+
+
+
+```shell
+curl -X DELETE https://example.com/wc-api/v3/taxes/53 \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.delete('taxes/53', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+delete('taxes/53')); ?>
+```
+
+```python
+print(wcapi.delete("taxes/53").json())
+```
+
+```ruby
+woocommerce.delete("taxes/53").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "message": "Deleted tax"
+}
+```
+
+
+
+## View Tax Rate Count ##
+
+This API lets you retrieve a count of all tax rates.
+
+### HTTP Request ###
+
+
+
+ GET
+ /wc-api/v3/taxes/count
+
+
+
+```shell
+curl https://example.com/wc-api/v3/taxes/count \
+ -u consumer_key:consumer_secret
+```
+
+```javascript
+WooCommerce.get('taxes/count', function(err, data, res) {
+ console.log(res);
+});
+```
+
+```php
+get('taxes/53')); ?>
+```
+
+```python
+print(wcapi.get("taxes/count").json())
+```
+
+```ruby
+woocommerce.get("taxes/count").parsed_response
+```
+
+> JSON response example:
+
+```json
+{
+ "count": 48
+}
+```
+
+#### Available Filters ####
+
+| Filter | Type | Description |
+| ---------------- | ------ | ----------------------------------------------------------------- |
+| `tax_rate_class` | string | Tax rates by class. eg: `standard`, `reduced-rate` or `zero-rate` |
+
+
diff --git a/source/includes/v3/_webhooks.md b/source/includes/v3/_webhooks.md
index b2652a5c..af9a5d39 100644
--- a/source/includes/v3/_webhooks.md
+++ b/source/includes/v3/_webhooks.md
@@ -1,6 +1,6 @@
# Webhooks #
-This section lists all API that can be used to create, edit or otherwise manipulate webhooks.
+This section lists all API endpoints that can be used to create, edit or otherwise manipulate webhooks.
## Webhooks Properties ##
@@ -48,7 +48,7 @@ This section lists all API that can be used to create, edit or otherwise manipul
| `X-WC-Webhook-ID` | integer | The webhook's ID |
| `X-WC-Webhook-Delivery-ID` | integer | The delivery ID |
-## Create A Webhook ##
+## Create a Webhook ##
This API helps you to create a new webhook.
@@ -90,6 +90,21 @@ WooCommerce.post('webhooks', data, function(err, data, res) {
});
```
+```php
+ [
+ 'name' => 'An add to cart webhook',
+ 'secret' => 'my-super-secret-private-key',
+ 'topic' => 'action.woocommerce_add_to_cart',
+ 'delivery_url' => 'http://requestb.in/1exdwip1'
+ ]
+];
+
+print_r($woocommerce->post('webhooks', $data));
+?>
+```
+
```python
data = {
"webhook": {
@@ -137,7 +152,7 @@ woocommerce.post("webhooks", data).parsed_response
}
```
-## View A Webhook ##
+## View a Webhook ##
This API lets you retrieve and view a specific webhook.
@@ -161,6 +176,10 @@ WooCommerce.get('webhooks/535', function(err, data, res) {
});
```
+```php
+get('webhooks/535')); ?>
+```
+
```python
print(wcapi.get("webhooks/535").json())
```
@@ -190,7 +209,7 @@ woocommerce.get("webhooks/535").parsed_response
}
```
-## View List Of Webhooks ##
+## View List of Webhooks ##
This API helps you to view all the webhooks.
@@ -214,6 +233,10 @@ WooCommerce.get('webhooks', function(err, data, res) {
});
```
+```php
+get('webhooks')); ?>
+```
+
```python
print(wcapi.get("webhooks").json())
```
@@ -267,7 +290,7 @@ woocommerce.get("webhooks").parsed_response
| -------- | ------ | ----------------------------------------------------------------------------------------------------------------- |
| `status` | string | Webhooks by status. The following options are available: `active` or `paused` and `disabled`. Default is `active` |
-## Update A Webhook ##
+## Update a Webhook ##
This API lets you make changes to a webhook.
@@ -303,6 +326,18 @@ WooCommerce.put('webhooks/535', data, function(err, data, res) {
});
```
+```php
+ [
+ 'status' => 'paused'
+ ]
+];
+
+print_r($woocommerce->put('webhooks/535', $data));
+?>
+```
+
```python
data = {
"webhook": {
@@ -344,7 +379,7 @@ woocommerce.put("webhooks/535", data).parsed_response
}
```
-## Delete A Webhook ##
+## Delete a Webhook ##
This API helps you delete a webhook.
@@ -368,6 +403,10 @@ WooCommerce.delete('webhooks/535', function(err, data, res) {
});
```
+```php
+delete('webhooks/535')); ?>
+```
+
```python
print(wcapi.delete("webhooks/535").json())
```
@@ -408,6 +447,10 @@ WooCommerce.get('webhooks/count', function(err, data, res) {
});
```
+```php
+get('webhooks/count')); ?>
+```
+
```python
print(wcapi.get("webhooks/count").json())
```
@@ -430,7 +473,7 @@ woocommerce.get("webhooks/count").parsed_response
| -------- | ------ | -------------------------------------------------------------------------------------------- |
| `status` | string | Webhooks by status. The following options are available: `active` or `paused` and `disabled` |
-## View A Webhooks Delivery ##
+## View a Webhooks Delivery ##
This API lets you retrieve and view a specific webhook delivery.
@@ -454,6 +497,10 @@ WooCommerce.get('webhooks/535/deliveries/378', function(err, data, res) {
});
```
+```php
+get('webhooks/535/deliveries/378')); ?>
+```
+
```python
print(wcapi.get("webhooks/535/deliveries/378").json())
```
@@ -504,7 +551,7 @@ woocommerce.get("webhooks/535/deliveries/378").parsed_response
View the Delivery Properties for more details on this response.
-## View List Of Webhooks Deliveries ##
+## View List of Webhooks Deliveries ##
This API helps you to view all deliveries from a specific webhooks.
@@ -528,6 +575,10 @@ WooCommerce.get('webhooks/535/deliveries', function(err, data, res) {
});
```
+```php
+get('webhooks/535/deliveries')); ?>
+```
+
```python
print(wcapi.get("webhooks/535/deliveries").json())
```
diff --git a/source/index.md b/source/index.md
index f7911b55..70f23b1e 100644
--- a/source/index.md
+++ b/source/index.md
@@ -4,6 +4,7 @@ title: WooCommerce REST API Documentation v3
language_tabs:
- shell: cURL
- javascript: Node.js
+ - php: PHP
- python: Python
- ruby: Ruby
@@ -14,7 +15,6 @@ toc_footers:
- WooCommerce Documentation
- WooCommerce Repository
- Documentation Powered by Slate
- -
includes:
- v3/introduction
@@ -22,8 +22,17 @@ includes:
- v3/coupons
- v3/customers
- v3/orders
+ - v3/order-notes
+ - v3/order-refunds
- v3/products
+ - v3/product-attributes
+ - v3/product-attribute-terms
+ - v3/product-categories
+ - v3/product-shipping-classes
+ - v3/product-tags
- v3/reports
+ - v3/taxes
+ - v3/tax-classes
- v3/webhooks
- v3/authentication-endpoint
diff --git a/source/v1.md b/source/v1.md
index 814247b4..37878335 100644
--- a/source/v1.md
+++ b/source/v1.md
@@ -12,7 +12,6 @@ toc_footers:
- WooCommerce Documentation
- WooCommerce Repository
- Documentation Powered by Slate
- -
includes:
- v1/docs
diff --git a/source/v2.md b/source/v2.md
index 2ee823e0..d8a4ac76 100644
--- a/source/v2.md
+++ b/source/v2.md
@@ -15,7 +15,6 @@ toc_footers:
- WooCommerce Documentation
- WooCommerce Repository
- Documentation Powered by Slate
- -
includes:
- v2/introduction