NAV
cURL Node.js PHP Python Ruby

Introduction

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

Requirements

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

Version

The current API version is v3 which takes a first-order position in endpoints. The following table shows API versions present in each major version of WooCommerce:

API 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, 2.5.x

The v1 and v2 APIs will be removed in future versions.

What's changed in v3?

Differences between v1 and v2

API Docs for past versions

Schema

The API is accessible via this endpoint:

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

Pretty permalinks must be enabled. You may access the API over either HTTP or HTTPS. HTTPS is recommended where possible, since authentication is simpler. The API index will declare if the site supports SSL or not.

Requests/Responses

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

Some general information about responses:

Authentication

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

Over HTTPS

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

HTTP Basic Auth example

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

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

Example for servers that not properly parse the Authorization header:

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

Over HTTP

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

Generating an OAuth signature

1) Set the HTTP method for the request:

GET

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

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

when encoded:

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

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

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

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

oauth_signature_method%3DHMAC-SHA1

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

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

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

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

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

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

OAuth Tips

Parameters

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

Filter Parameter

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

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

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

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

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

Available Filters

Filter Description
created_at_min given a date, only resources created after the provided date will be returned
created_at_max given a date, only resources created before the provided date will be returned
updated_at_min given a date, only resources updated after the provided date will be returned
updated_at_max given a date, only resources updated before the provided date will be returned
q performs a keyword search and returns resources that match, e.g. GET /products?filter[q]=search-keyword. Note that search terms should be URL-encoded as they will be decoded internally with urldecode
order controls the ordering of the resources returned, accepted values are ASC (default) or DESC
orderby controls the field that is used for ordering the resources returned. Accepts the same arguments as WP_Query. Defaults to date. You can order by meta_value but you must provide orderby_meta_key
orderby_meta_key the meta key to order returned resources by when using orderby=meta_value. For example, you could order products by price using GET /products?filter[orderby]=meta_value_num&filter[orderby_meta_key]=_price
post_status limits resources to only those with the specified post status. Most useful for returning unpublished products, e.g. GET /products?filter[post_status]=draft
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 format in the UTC timezone: YYYY-MM-DDTHH:MM:SSZ. You may omit the time and timezone if desired.

Fields Parameter

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

GET /orders?fields=id

To include multiple fields, separate them with commas:

GET /orders?fields=id,status

You can specify sub-fields using dot-notation:

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

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

GET /orders?fields=line_items.product_id

Pagination

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

GET /orders?filter[limit]=15

You can specify further pages with the ?page parameter:

GET /orders?page=2

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

GET /orders?filter[offset]=5

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

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

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

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

Linebreak included for readability

The possible rel values are:

Value Description
next Shows the URL of the immediate next page of results
last Shows the URL of the last page of results
first Shows the URL of the first page of results
prev Shows the URL of the immediate previous page of results

Errors

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

400 Bad Request example:

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

401 Unauthorized example:

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

404 Not Found example:

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

500 Internal Server Error example:

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

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

HTTP Verbs

The API uses the appropriate HTTP verb for each action:

Verb Description
HEAD Can be used for any endpoint to return just the HTTP header information
GET Used for retrieving resources
PUT Used for updating resources
POST Used for creating resources
DELETE Used for deleting resources

JSONP Support

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

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

Response:

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

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

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

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

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

Webhooks

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

Each webhook has:

Topics

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

Core topics are:

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

Delivery/Payload

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

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

Logging

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

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

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

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

Endpoints

See the webhook resource section.

Visual Interface

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

Troubleshooting

Official Libraries

// Install:
// npm install --save woocommerce-api

// Setup:
var WooCommerceAPI = require('woocommerce-api');

var WooCommerce = new WooCommerceAPI({
  url: 'http://example.com', // Your store URL
  consumerKey: 'consumer_key', // Your consumer key
  consumerSecret: 'consumer_secret', // Your consumer secret
  version: 'v3' // WooCommerce API version
});
<?php 
// Install:
// composer require automattic/woocommerce

// Setup:
require __DIR__ . '/vendor/autoload.php';

use Automattic\WooCommerce\Client;

$woocommerce = new Client(
    'http://example.com', // Your store URL
    'consumer_key', // Your consumer key
    'consumer_secret', // Your consumer secret
    [
        'version' => 'v3' // WooCommerce API version
    ]
);
?>
# Install:
# pip install woocommerce

# Setup:
from woocommerce import API

wcapi = API(
    url="http://example.com", # Your store URL
    consumer_key="consumer_key", # Your consumer key
    consumer_secret="consumer_secret", # Your consumer secret
    version="v3" # WooCommerce API version
)
# Install:
# gem install woocommerce_api

# Setup:
require "woocommerce_api"

woocommerce = WooCommerce::API.new(
  "http://example.com", # Your store URL
  "consumer_key", # Your consumer key
  "consumer_secret", # Your consumer secret
  {
    version: "v3" # WooCommerce API version
  }
)

Tools

Index

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

404 Not Found response:

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

Index Properties

Attribute Type Description
name string The name of the site - get_option( 'blogname' )
description string The site's description - get_option( 'blogdescription' )
URL string The site's URL - get_option( 'siteurl' )
wc_version string The active WooCommerce version
version string REST API version
routes array A list of available endpoints for the site keyed by relative URL. Each endpoint specifies the HTTP methods supported as well as the canonical URL
meta array A list of WooCommerce settings used in the API. See Meta Properties

Meta Properties

Attribute Type Description
timezone string The site's timezone
currency string Currency ISO Code, e.g. GBP
currency_format string Currency symbol, HTML encoded, e.g. £
currency_position string Currency position, available the following options: right, left, right_space and left_space
thousand_separator string Thousands separator, e.g .
decimal_separator string Decimal separator, e.g ,
price_num_decimals integer Number of decimals
tax_included boolean True if prices include tax, false otherwise
weight_unit string The unit set for product weights. Valid units are kg, g, lbs, oz
dimension_unit string The unit set for product dimensions. Valid units are cm, m, cm, mm, in, and yd
ssl_enabled boolean True if SSL is enabled for the site, false otherwise
permalinks_enabled boolean Whether pretty permalinks are enabled on the site, if this is false, the API will not function correctly
generate_password boolean Shows if the API is able to auto generate passwords for new customers
links array API help links list

View Index List

Retrieve a set of store information.

HTTP Request

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

JSON response example:

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

Coupons

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

Coupon Properties

Attribute Type Description
id integer Coupon ID (post ID) read-only
code string Coupon code, always lowercase mandatory
type string Coupon type, valid core types are: fixed_cart, percent, fixed_product and percent_product. Default is fixed_cart
created_at string UTC DateTime when the coupon was created read-only
updated_at string UTC DateTime when the coupon was last updated read-only
amount string The amount of discount
individual_use boolean Whether coupon can only be used individually
product_ids array Array of product ID's the coupon can be used on
exclude_product_ids array Array of product ID's the coupon cannot be used on
usage_limit integer How many times the coupon can be used
usage_limit_per_user integer How many times the coupon can be user per customer
limit_usage_to_x_items integer Max number of items in the cart the coupon can be applied to
usage_count integer Number of times the coupon has been used already read-only
expiry_date string UTC DateTime`when the coupon expires
enable_free_shipping boolean Is the coupon for free shipping
product_category_ids array Array of category ID's the coupon applies to
exclude_product_category_ids array Array of category ID's the coupon does not apply to
exclude_sale_items boolean Exclude sale items from the coupon
minimum_amount string Minimum order amount that needs to be in the cart before coupon applies
maximum_amount string Maximum order amount allowed when using the coupon
customer_emails array Array of email addresses that can use this coupon
description string Coupon description

Create a Coupon

This API helps you to create a new coupon.

HTTP Request

POST
/wc-api/v3/coupons
curl -X POST https://example.com/wc-api/v3/coupons \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "coupon": {
    "code": "new-coupon",
    "type": "percent",
    "amount": 10,
    "individual_use": true,
    "product_ids": [],
    "exclude_product_ids": [],
    "usage_limit": "",
    "usage_limit_per_user": "",
    "limit_usage_to_x_items": "",
    "expiry_date": "",
    "enable_free_shipping": false,
    "product_category_ids": [],
    "exclude_product_category_ids": [],
    "exclude_sale_items": true,
    "minimum_amount": "100.00",
    "maximum_amount": "0.00",
    "customer_emails": [],
    "description": ""
  }
}'
var data = {
  coupon: {
    code: 'new-coupon',
    type: 'percent',
    amount: 10,
    individual_use: true,
    product_ids: [],
    exclude_product_ids: [],
    usage_limit: '',
    usage_limit_per_user: '',
    limit_usage_to_x_items: '',
    expiry_date: '',
    enable_free_shipping: false,
    product_category_ids: [],
    exclude_product_category_ids: [],
    exclude_sale_items: true,
    minimum_amount: '100.00',
    maximum_amount: '0.00',
    customer_emails: [],
    description: ''
  }
};

WooCommerce.post('coupons', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'coupon' => [
        'code' => 'new-coupon',
        'type' => 'percent',
        'amount' => 10,
        'individual_use' => true,
        'product_ids' => [],
        'exclude_product_ids' => [],
        'usage_limit' => '',
        'usage_limit_per_user' => '',
        'limit_usage_to_x_items' => '',
        'expiry_date' => '',
        'enable_free_shipping' => false,
        'product_category_ids' => [],
        'exclude_product_category_ids' => [],
        'exclude_sale_items' => true,
        'minimum_amount' => '100.00',
        'maximum_amount' => '0.00',
        'customer_emails' => [],
        'description' => ''
    ]
];

print_r($woocommerce->post('coupons', $data));
?>
data = {
    "coupon": {
        "code": "new-coupon",
        "type": "percent",
        "amount": 10,
        "individual_use": True,
        "product_ids": [],
        "exclude_product_ids": [],
        "usage_limit": "",
        "usage_limit_per_user": "",
        "limit_usage_to_x_items": "",
        "expiry_date": "",
        "enable_free_shipping": False,
        "product_category_ids": [],
        "exclude_product_category_ids": [],
        "exclude_sale_items": True,
        "minimum_amount": "100.00",
        "maximum_amount": "0.00",
        "customer_emails": [],
        "description": ""
    }
}

print(wcapi.post("coupons", data).json())
data = {
  coupon: {
    code: "new-coupon",
    type: "percent",
    amount: 10,
    individual_use: true,
    product_ids: [],
    exclude_product_ids: [],
    usage_limit: "",
    usage_limit_per_user: "",
    limit_usage_to_x_items: "",
    expiry_date: "",
    enable_free_shipping: false,
    product_category_ids: [],
    exclude_product_category_ids: [],
    exclude_sale_items: true,
    minimum_amount: "100.00",
    maximum_amount: "0.00",
    customer_emails: [],
    description: ""
  }
}

woocommerce.post("coupons", data).parsed_response

JSON response example:

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

View a Coupon

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

HTTP Request

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

JSON response example:

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

View List of Coupons

This API helps you to view all the coupons.

HTTP Request

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

JSON response example:

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

Update a Coupon

This API lets you make changes to a coupon.

HTTP Request

PUT
/wc-api/v3/coupons/<id>
curl -X PUT https://example.com/wc-api/v3/coupons/529 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "coupon": {
    "amount": 5
  }
}'
var data = {
  coupon: {
    amount: 5
  }
};

WooCommerce.put('coupons/529', data, function(err, data, res) {
  console.log(res);
});
<?php 
$data = [
    'coupon' => [
        'amount' => 5
    ]
];

print_r($woocommerce->put('coupons/529', $data)); 
?>
data = {
    "coupon": {
        "amount": 5
    }
}

print(wcapi.put("coupons/529", data).json())
data = {
  coupon: {
    amount: 5
  }
}

woocommerce.put("coupons/529", data).parsed_response

JSON response example:

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

Create/Update Multiple Coupons

This API helps you to bulk create/update multiple coupons.

To update is necessary to send objects containing IDs and to create new not just send the ID.

HTTP Request

POST
/wc-api/v3/coupons/bulk
curl -X POST https://example.com/wc-api/v3/coupons/bulk \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "coupons": [
    {
      "id": 529,
      "amount": "15.00"
    },
    {
      "id": 527,
      "minimum_amount": "55.00"
    },
    {
      "id": 526,
      "amount": "20.00"
    }
  ]
}'
var data = {
  coupons: [
    {
      id: 529,
      amount: '15.00'
    },
    {
      id: 527,
      minimum_amount: '55.00'
    },
    {
      id: 526,
      amount: '20.00'
    }
  ]
};

WooCommerce.post('coupons/bulk', data, function(err, data, res) {
  console.log(res);
});
<?php 
$data = [
    'coupons' => [
        [
            'id' => 529,
            'amount' => '15.00'
        ],
        [
            'id' => 527,
            'minimum_amount' => '55.00'
        ],
        [
            'id' => 526,
            'amount': '20.00'
        ]
    ]
];

print_r($woocommerce->post('coupons/bulk', $data)); 
?>
data = {
    "coupons": [
        {
            "id": 529,
            "amount": "15.00"
        },
        {
            "id": 527,
            "minimum_amount": "55.00"
        },
        {
            "id": 526,
            "amount": "20.00"
        }
    ]
}

print(wcapi.post("coupons/bulk", data).json())
data = {
  coupons: [
    {
      id: 529,
      amount: "15.00"
    },
    {
      id: 527,
      minimum_amount: "55.00"
    },
    {
      id: 526,
      amount: "20.00"
    }
  ]
}

woocommerce.post("coupons/bulk", data).parsed_response

JSON response example:

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

Delete a Coupon

This API helps you delete a coupon.

HTTP Request

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

JSON response example:

{
  "message": "Permanently deleted coupon"
}

Parameters

Parameter Type Description
force string Use true whether to permanently delete the coupon, defaults to false. Note that permanently deleting the coupon will return HTTP 200 rather than HTTP 202.

View Coupons Count

This API lets you retrieve a count of all coupons.

HTTP Request

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

JSON response example:

{
  "count": 3
}

Customers

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

Customers Properties

Attribute Type Description
id integer Customer ID (user ID) read-only
created_at string UTC DateTime when the customer was created read-only
email string Customer email address mandatory
first_name string Customer first name
last_name string Customer last name
username string Customer username, can be generated automatically from the customer's email addrees if the option woocommerce_registration_generate_username is equal to yes cannot be changed
password string Customer password, can be generated automatically with wp_generate_password() if the "Automatically generate customer password" option is enabled, check the index meta for generate_password write-only
last_order_id integer Last order ID read-only
last_order_date string UTC DateTime of the customer last order read-only
orders_count integer Quantity of orders that the customer have read-only
total_spent integer Total amount spent read-only
avatar_url string Gravatar URL
billing_address array List of Billing Address fields. See Billing Address Properties
shipping_address array List of Shipping Address fields. See Shipping Address Properties

Billing Address Properties

Attribute Type Description
first_name string First name
last_name string Last name
company string Company name
address_1 string Address line 1
address_2 string Address line 2
city string City name
state string ISO code or name of the state, province or district
postcode string Postal code
country string ISO code of the country
email string Email address
phone string Phone

Shipping Address Properties

Attribute Type Description
first_name string First name
last_name string Last name
company string Company name
address_1 string Address line 1
address_2 string Address line 2
city string City name
state string ISO code or name of the state, province or district
postcode string Postal code
country string ISO code of the country

Create a Customer

This API helps you to create a new customer.

HTTP Request

POST
/wc-api/v3/customers
curl -X POST https://example.com/wc-api/v3/customers \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "customer": {
    "email": "john.doe@example.com",
    "first_name": "John",
    "last_name": "Doe",
    "username": "john.doe",
    "billing_address": {
      "first_name": "John",
      "last_name": "Doe",
      "company": "",
      "address_1": "969 Market",
      "address_2": "",
      "city": "San Francisco",
      "state": "CA",
      "postcode": "94103",
      "country": "US",
      "email": "john.doe@example.com",
      "phone": "(555) 555-5555"
    },
    "shipping_address": {
      "first_name": "John",
      "last_name": "Doe",
      "company": "",
      "address_1": "969 Market",
      "address_2": "",
      "city": "San Francisco",
      "state": "CA",
      "postcode": "94103",
      "country": "US"
    }
  }
}'
var data = {
  customer: {
    email: 'john.doe@example.com',
    first_name: 'John',
    last_name: 'Doe',
    username: 'john.doe',
    billing_address: {
      first_name: 'John',
      last_name: 'Doe',
      company: '',
      address_1: '969 Market',
      address_2: '',
      city: 'San Francisco',
      state: 'CA',
      postcode: '94103',
      country: 'US',
      email: 'john.doe@example.com',
      phone: '(555) 555-5555'
    },
    shipping_address: {
      first_name: 'John',
      last_name: 'Doe',
      company: '',
      address_1: '969 Market',
      address_2: '',
      city: 'San Francisco',
      state: 'CA',
      postcode: '94103',
      country: 'US'
    }
  }
};

WooCommerce.post('customers', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'customer' => [
        'email' => 'john.doe@example.com',
        'first_name' => 'John',
        'last_name' => 'Doe',
        'username' => 'john.doe',
        'billing_address' => [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'company' => '',
            'address_1' => '969 Market',
            'address_2' => '',
            'city' => 'San Francisco',
            'state' => 'CA',
            'postcode' => '94103',
            'country' => 'US',
            'email' => 'john.doe@example.com',
            'phone' => '(555) 555-5555'
        ],
        'shipping_address' => [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'company' => '',
            'address_1' => '969 Market',
            'address_2' => '',
            'city' => 'San Francisco',
            'state' => 'CA',
            'postcode' => '94103',
            'country' => 'US'
        ]
    ]
];

print_r($woocommerce->post('customers', $data));
?>
data = {
    "customer": {
        "email": "john.doe@example.com",
        "first_name": "John",
        "last_name": "Doe",
        "username": "john.doe",
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "company": "",
            "address_1": "969 Market",
            "address_2": "",
            "city": "San Francisco",
            "state": "CA",
            "postcode": "94103",
            "country": "US",
            "email": "john.doe@example.com",
            "phone": "(555) 555-5555"
        },
        "shipping_address": {
            "first_name": "John",
            "last_name": "Doe",
            "company": "",
            "address_1": "969 Market",
            "address_2": "",
            "city": "San Francisco",
            "state": "CA",
            "postcode": "94103",
            "country": "US"
        }
    }
}

print(wcapi.post("customers", data).json())
data = {
  customer: {
    email: "john.doe@example.com",
    first_name: "John",
    last_name: "Doe",
    username: "john.doe",
    billing_address: {
      first_name: "John",
      last_name: "Doe",
      company: "",
      address_1: "969 Market",
      address_2: "",
      city: "San Francisco",
      state: "CA",
      postcode: "94103",
      country: "US",
      email: "john.doe@example.com",
      phone: "(555) 555-5555"
    },
    shipping_address: {
      first_name: "John",
      last_name: "Doe",
      company: "",
      address_1: "969 Market",
      address_2: "",
      city: "San Francisco",
      state: "CA",
      postcode: "94103",
      country: "US"
    }
  }
}

woocommerce.post("customers", data).parsed_response

JSON response example:

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

View a Customer

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

HTTP Request

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

JSON response example:

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

View List of Customers

This API helps you to view all the customers.

HTTP Request

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

JSON response example:

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

Available Filters

Filter Type Description
role string Customers by status. eg: customer or subscriber

Update a Customer

This API lets you make changes to a customer.

HTTP Request

PUT
/wc-api/v3/customers/<id>
curl -X PUT https://example.com/wc-api/v3/customers/2 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "customer": {
    "first_name": "James",
    "billing_address": {
      "first_name": "James"
    },
    "shipping_address": {
      "first_name": "James"
    }
  }
}'
var data = {
  customer: {
    first_name: 'James',
    billing_address: {
      first_name: 'James'
    },
    shipping_address: {
      first_name: 'James'
    }
  }
};

WooCommerce.put('customers/2', data, function(err, data, res) {
  console.log(res);
});
<?php 
$data = [
    'customer' => [
        'first_name' => 'James',
        'billing_address' => [
            'first_name' => 'James'
        ],
        'shipping_address' => [
            'first_name' => 'James'
        ]
    ]
];

print_r($woocommerce->put('customers/2', $data));
?>
data = {
    "customer": {
        "first_name": "James",
        "billing_address": {
            "first_name": "James"
        },
        "shipping_address": {
            "first_name": "James"
        }
    }
}

print(wcapi.put("customers/2", data).json())
data = {
  customer: {
    first_name: "James",
    billing_address: {
      first_name: "James"
    },
    shipping_address: {
      first_name: "James"
    }
  }
}

woocommerce.put("customers/2", data).parsed_response

JSON response example:

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

Create/Update Multiple Customers

This API helps you to bulk create/update multiple customers.

To update is necessary to send objects containing IDs and to create new not just send the ID.

HTTP Request

POST
/wc-api/v3/customers/bulk
curl -X POST https://example.com/wc-api/v3/customers/bulk \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "customers": [
    {
      "email": "john.doe2@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "username": "john.doe2",
      "billing_address": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US",
        "email": "john.doe@example.com",
        "phone": "(555) 555-5555"
      },
      "shipping_address": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US"
      }
    },
    {
      "email": "joao.silva2@example.com",
      "first_name": "João",
      "last_name": "Silva",
      "username": "joao.silva2",
      "billing_address": {
        "first_name": "João",
        "last_name": "Silva",
        "company": "",
        "address_1": "Av. Brasil, 432",
        "address_2": "",
        "city": "Rio de Janeiro",
        "state": "RJ",
        "postcode": "12345-000",
        "country": "BR",
        "email": "joao.silva@example.com",
        "phone": "(55) 5555-5555"
      },
      "shipping_address": {
        "first_name": "João",
        "last_name": "Silva",
        "company": "",
        "address_1": "Av. Brasil, 432",
        "address_2": "",
        "city": "Rio de Janeiro",
        "state": "RJ",
        "postcode": "12345-000",
        "country": "BR"
      }
    }
  ]
}'
var data = {
  customers: [
    {
      email: 'john.doe2@example.com',
      first_name: 'John',
      last_name: 'Doe',
      username: 'john.doe2',
      billing_address: {
        first_name: 'John',
        last_name: 'Doe',
        company: '',
        address_1: '969 Market',
        address_2: '',
        city: 'San Francisco',
        state: 'CA',
        postcode: '94103',
        country: 'US',
        email: 'john.doe@example.com',
        phone: '(555) 555-5555'
      },
      shipping_address: {
        first_name: 'John',
        last_name: 'Doe',
        company: '',
        address_1: '969 Market',
        address_2: '',
        city: 'San Francisco',
        state: 'CA',
        postcode: '94103',
        country: 'US'
      }
    },
    {
      email: "joao.silva2@example.com",
      first_name: "João",
      last_name: "Silva",
      username: "joao.silva2",
      billing_address: {
        first_name: "João",
        last_name: "Silva",
        company: "",
        address_1: "Av. Brasil, 432",
        address_2: "",
        city: "Rio de Janeiro",
        state: "RJ",
        postcode: "12345-000",
        country: "BR",
        email: "joao.silva@example.com",
        phone: "(55) 5555-5555"
      },
      shipping_address: {
        first_name: "João",
        last_name: "Silva",
        company: "",
        address_1: "Av. Brasil, 432",
        address_2: "",
        city: "Rio de Janeiro",
        state: "RJ",
        postcode: "12345-000",
        country: "BR"
      }
    }
  ]
};

WooCommerce.post('customers/bulk', data, function(err, data, res) {
  console.log(res);
});
<?php 
$data = [
    'customers': [
        [
            'email': 'john.doe2@example.com',
            'first_name': 'John',
            'last_name': 'Doe',
            'username': 'john.doe2',
            'billing_address': [
                'first_name': 'John',
                'last_name': 'Doe',
                'company': '',
                'address_1': '969 Market',
                'address_2': '',
                'city': 'San Francisco',
                'state': 'CA',
                'postcode': '94103',
                'country': 'US',
                'email': 'john.doe@example.com',
                'phone': '(555) 555-5555'
            ],
            'shipping_address': [
                'first_name': 'John',
                'last_name': 'Doe',
                'company': '',
                'address_1': '969 Market',
                'address_2': '',
                'city': 'San Francisco',
                'state': 'CA',
                'postcode': '94103',
                'country': 'US'
            ]
        ],
        [
            'email': 'joao.silva2@example.com',
            'first_name': 'João',
            'last_name': 'Silva',
            'username': 'joao.silva2',
            'billing_address': [
                'first_name': 'João',
                'last_name': 'Silva',
                'company': '',
                'address_1': 'Av. Brasil, 432',
                'address_2': '',
                'city': 'Rio de Janeiro',
                'state': 'RJ',
                'postcode': '12345-000',
                'country': 'BR',
                'email': 'joao.silva@example.com',
                'phone': '(55) 5555-5555'
            ],
            'shipping_address': [
                'first_name': 'João',
                'last_name': 'Silva',
                'company': '',
                'address_1': 'Av. Brasil, 432',
                'address_2': '',
                'city': 'Rio de Janeiro',
                'state': 'RJ',
                'postcode': '12345-000',
                'country': 'BR'
            ]
        ]
    ]
];

print_r($woocommerce->post('customers/bulk', $data));
?>
data = {
    "customers": [
        {
            "email": "john.doe2@example.com",
            "first_name": "John",
            "last_name": "Doe",
            "username": "john.doe2",
            "billing_address": {
                "first_name": "John",
                "last_name": "Doe",
                "company": "",
                "address_1": "969 Market",
                "address_2": "",
                "city": "San Francisco",
                "state": "CA",
                "postcode": "94103",
                "country": "US",
                "email": "john.doe@example.com",
                "phone": "(555) 555-5555"
            },
            "shipping_address": {
                "first_name": "John",
                "last_name": "Doe",
                "company": "",
                "address_1": "969 Market",
                "address_2": "",
                "city": "San Francisco",
                "state": "CA",
                "postcode": "94103",
                "country": "US"
            }
        },
        {
            "email": "joao.silva2@example.com",
            "first_name": "João",
            "last_name": "Silva",
            "username": "joao.silva2",
            "billing_address": {
                "first_name": "João",
                "last_name": "Silva",
                "company": "",
                "address_1": "Av. Brasil, 432",
                "address_2": "",
                "city": "Rio de Janeiro",
                "state": "RJ",
                "postcode": "12345-000",
                "country": "BR",
                "email": "joao.silva@example.com",
                "phone": "(55) 5555-5555"
            },
            "shipping_address": {
                "first_name": "João",
                "last_name": "Silva",
                "company": "",
                "address_1": "Av. Brasil, 432",
                "address_2": "",
                "city": "Rio de Janeiro",
                "state": "RJ",
                "postcode": "12345-000",
                "country": "BR"
            }
        }
    ]
}

print(wcapi.post("customers/bulk", data).json())
data = {
  customers: [
    {
      email: "john.doe2@example.com",
      first_name: "John",
      last_name: "Doe",
      username: "john.doe2",
      billing_address: {
        first_name: "John",
        last_name: "Doe",
        company: "",
        address_1: "969 Market",
        address_2: "",
        city: "San Francisco",
        state: "CA",
        postcode: "94103",
        country: "US",
        email: "john.doe@example.com",
        phone: "(555) 555-5555"
      },
      shipping_address: {
        first_name: "John",
        last_name: "Doe",
        company: "",
        address_1: "969 Market",
        address_2: "",
        city: "San Francisco",
        state: "CA",
        postcode: "94103",
        country: "US"
      }
    },
    {
      email: "joao.silva2@example.com",
      first_name: "João",
      last_name: "Silva",
      username: "joao.silva2",
      billing_address: {
        first_name: "João",
        last_name: "Silva",
        company: "",
        address_1: "Av. Brasil, 432",
        address_2: "",
        city: "Rio de Janeiro",
        state: "RJ",
        postcode: "12345-000",
        country: "BR",
        email: "joao.silva@example.com",
        phone: "(55) 5555-5555"
      },
      shipping_address: {
        first_name: "João",
        last_name: "Silva",
        company: "",
        address_1: "Av. Brasil, 432",
        address_2: "",
        city: "Rio de Janeiro",
        state: "RJ",
        postcode: "12345-000",
        country: "BR"
      }
    }
  ]
}

woocommerce.post("customers/bulk", data).parsed_response

JSON response example:

{
  "customers": [
    {
      "id": 4,
      "created_at": "2015-07-31T14:20:46Z",
      "email": "john.doe2@example.com",
      "first_name": "John",
      "last_name": "Doe",
      "username": "john.doe2",
      "last_order_id": null,
      "last_order_date": null,
      "orders_count": 0,
      "total_spent": "0.00",
      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
      "billing_address": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US",
        "email": "john.doe@example.com",
        "phone": "(555) 555-5555"
      },
      "shipping_address": {
        "first_name": "John",
        "last_name": "Doe",
        "company": "",
        "address_1": "969 Market",
        "address_2": "",
        "city": "San Francisco",
        "state": "CA",
        "postcode": "94103",
        "country": "US"
      }
    },
    {
      "id": 5,
      "created_at": "2015-07-31T14:20:46Z",
      "email": "joao.silva2@example.com",
      "first_name": "João",
      "last_name": "Silva",
      "username": "joao.silva2",
      "last_order_id": null,
      "last_order_date": null,
      "orders_count": 0,
      "total_spent": "0.00",
      "avatar_url": "https://secure.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=96",
      "billing_address": {
        "first_name": "João",
        "last_name": "Silva",
        "company": "",
        "address_1": "Av. Brasil, 432",
        "address_2": "",
        "city": "Rio de Janeiro",
        "state": "RJ",
        "postcode": "12345-000",
        "country": "BR",
        "email": "joao.silva@example.com",
        "phone": "(55) 5555-5555"
      },
      "shipping_address": {
        "first_name": "João",
        "last_name": "Silva",
        "company": "",
        "address_1": "Av. Brasil, 432",
        "address_2": "",
        "city": "Rio de Janeiro",
        "state": "RJ",
        "postcode": "12345-000",
        "country": "BR"
      }
    }
  ]
}

Delete a Customer

This API helps you delete a customer.

HTTP Request

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

JSON response example:

{
  "message": "Permanently deleted customer"
}

View Customer Orders

This API lets you retrieve the customers orders.

HTTP Request

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

JSON response example:

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

View Customer Downloads

This API lets you retrieve the customers downloads.

HTTP Request

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

JSON response example:

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

Customer Downloads Properties

Attribute Type Description
download_url string Download file URL
download_id string Download ID
product_id integer Downloadable product ID
download_name string Downloadable file name
order_id integer Order ID
order_key string Order Key
downloads_remaining string Amount of downloads remaining. An empty string means that is "Unlimited"
access_expires string UTC DateTime when the download access expires. null means "Never"
file array List for downloadable files, each one have a name (file name) and file (file URL) attribute

View Customers Count

This API lets you retrieve a count of all customers.

HTTP Request

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

JSON response example:

{
  "count": 10
}

Available Filters

Filter Type Description
role string Customers by status. eg: customer or subscriber

Orders

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

Orders Properties

Attribute Type Description
id integer Order ID (post ID) read-only
order_number integer Order number read-only
created_at string UTC DateTime when the order was created read-only
updated_at string UTC DateTime when the order was last updated read-only
completed_at string UTC DateTime when the order was last completed read-only
status string Order status. By default are available the status: pending, processing, on-hold, completed, cancelled, refunded and failed. See View List of Order Statuses
currency string Currency in ISO format, e.g USD
total string Order total read-only
subtotal string Order subtotal read-only
total_line_items_quantity integer Total of order items read-only
total_tax string Order tax total read-only
total_shipping string Order shipping total read-only
cart_tax string Order cart tax read-only
shipping_tax string Order shipping tax read-only
total_discount string Order total discount read-only
shipping_methods string Text list of the shipping methods used in the order read-only
payment_details array List of payment details. See Payment Details Properties
billing_address array List of customer billing address. See Customer Billing Address Properties
shipping_address array List of customer shipping address. See Customer Shipping Address Properties
note string Customer order notes
customer_ip string Customer IP address read-only
customer_user_agent string Customer User-Agent read-only
customer_id integer Customer ID (user ID) required
view_order_url string URL to view the order in frontend read-only
line_items array List of order line items. See Line Items Properties
shipping_lines array List of shipping line items. See Shipping Lines Properties
tax_lines array List of tax line items. See Tax Lines Properties read-only
fee_lines array List of fee line items. See Fee Lines Properites
coupon_lines array List of cupon line items. See Coupon Lines Properties
customer array Customer data. See Customer Properties

Payment Details Properties

Attribute Type Description
method_id string Payment method ID required
method_title string Payment method title required
paid boolean Shows/define if the order is paid using this payment method. Use true to complate the payment.
transaction_id string Transaction ID, an optional field to set the transacion ID when complate one payment (to set this you need set the paid as true too)

Line Items Properties

Attribute Type Description
id integer Line item ID read-only
subtotal string Line item subtotal
subtotal_tax string Line item tax subtotal
total string Line item total
total_tax string Line item tax total
price string Product price read-only
quantity integer Quantity
tax_class string Product tax class read-only
name string Product name read-only
product_id integer Product ID required
sku string Product SKU read-only
meta array List of product meta items. See Products Meta Items Properties
variations array List of product variation attributes. e.g: "variation": {"pa_color": "Black", "pa_size": "XGG"} (Use pa_ prefix when is a product attribute) write-only

Products Meta Items Properties

Attribute Type Description
key string Meta item key
label string Meta item label
value string Meta item value

Shipping Lines Properties

Attribute Type Description
id integer Shipping line ID read-only
method_id string Shipping method ID required
method_title string Shipping method title required
total string Total amount

Tax Lines Properties

Attribute Type Description
id integer Tax rate line ID read-only
rate_id integer Tax rate ID read-only
code string Tax rate code read-only
title string Tax rate title/name read-only
total string Tax rate total read-only
compound boolean Shows if is or not a compound rate. Compound tax rates are applied on top of other tax rates. read-only

Fee Lines Properites

Attribute Type Description
id integer Fee line ID read-only
title string Shipping method title required
taxable boolean Shows/define if the fee is taxable write-only
tax_class string Tax class, requered in write-mode if the fee is taxable
total string Total amount
total_tax string Tax total

Coupon Lines Properties

Attribute Type Description
id integer Coupon line ID read-only
code string Coupon code required
amount string Total amount required

Create an Order

This API helps you to create a new order.

HTTP Request

POST
/wc-api/v3/orders

Example of create a paid order:

curl -X POST https://example.com/wc-api/v3/orders \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "order": {
    "payment_details": {
      "method_id": "bacs",
      "method_title": "Direct Bank Transfer",
      "paid": true
    },
    "billing_address": {
      "first_name": "John",
      "last_name": "Doe",
      "address_1": "969 Market",
      "address_2": "",
      "city": "San Francisco",
      "state": "CA",
      "postcode": "94103",
      "country": "US",
      "email": "john.doe@example.com",
      "phone": "(555) 555-5555"
    },
    "shipping_address": {
      "first_name": "John",
      "last_name": "Doe",
      "address_1": "969 Market",
      "address_2": "",
      "city": "San Francisco",
      "state": "CA",
      "postcode": "94103",
      "country": "US"
    },
    "customer_id": 2,
    "line_items": [
      {
        "product_id": 546,
        "quantity": 2
      },
      {
        "product_id": 613,
        "quantity": 1,
        "variations": {
          "pa_color": "Black"
        }
      }
    ],
    "shipping_lines": [
      {
        "method_id": "flat_rate",
        "method_title": "Flat Rate",
        "total": "10.00"
      }
    ]
  }
}'
var data = {
  order: {
    payment_details: {
      method_id: 'bacs',
      method_title: 'Direct Bank Transfer',
      paid: true
    },
    billing_address: {
      first_name: 'John',
      last_name: 'Doe',
      address_1: '969 Market',
      address_2: '',
      city: 'San Francisco',
      state: 'CA',
      postcode: '94103',
      country: 'US',
      email: 'john.doe@example.com',
      phone: '(555) 555-5555'
    },
    shipping_address: {
      first_name: 'John',
      last_name: 'Doe',
      address_1: '969 Market',
      address_2: '',
      city: 'San Francisco',
      state: 'CA',
      postcode: '94103',
      country: 'US'
    },
    customer_id: 2,
    line_items: [
      {
        product_id: 546,
        quantity: 2
      },
      {
        product_id: 613,
        quantity: 1,
        variations: {
          pa_color: 'Black'
        }
      }
    ],
    shipping_lines: [
      {
        method_id: 'flat_rate',
        method_title: 'Flat Rate',
        total: '10.00'
      }
    ]
  }
};

WooCommerce.post('orders', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'order' => [
        'payment_details' => [
            'method_id' => 'bacs',
            'method_title' => 'Direct Bank Transfer',
            'paid' => true
        ],
        'billing_address' => [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'address_1' => '969 Market',
            'address_2' => '',
            'city' => 'San Francisco',
            'state' => 'CA',
            'postcode' => '94103',
            'country' => 'US',
            'email' => 'john.doe@example.com',
            'phone' => '(555) 555-5555'
        ],
        'shipping_address' => [
            'first_name' => 'John',
            'last_name' => 'Doe',
            'address_1' => '969 Market',
            'address_2' => '',
            'city' => 'San Francisco',
            'state' => 'CA',
            'postcode' => '94103',
            'country' => 'US'
        ],
        'customer_id' => 2,
        'line_items' => [
            [
                'product_id' => 546,
                'quantity' => 2
            ],
            [
                'product_id' => 613,
                'quantity' => 1,
                'variations' => [
                    'pa_color' => 'Black'
                ]
            ]
        ],
        'shipping_lines' => [
            [
                'method_id' => 'flat_rate',
                'method_title' => 'Flat Rate',
                'total' => '10.00'
            ]
        ]
    ]
];

print_r($woocommerce->post('orders', $data));
?>
data = {
    "order": {
        "payment_details": {
            "method_id": "bacs",
            "method_title": "Direct Bank Transfer",
            "paid": True
        },
        "billing_address": {
            "first_name": "John",
            "last_name": "Doe",
            "address_1": "969 Market",
            "address_2": "",
            "city": "San Francisco",
            "state": "CA",
            "postcode": "94103",
            "country": "US",
            "email": "john.doe@example.com",
            "phone": "(555) 555-5555"
        },
        "shipping_address": {
            "first_name": "John",
            "last_name": "Doe",
            "address_1": "969 Market",
            "address_2": "",
            "city": "San Francisco",
            "state": "CA",
            "postcode": "94103",
            "country": "US"
        },
        "customer_id": 2,
        "line_items": [
            {
                "product_id": 546,
                "quantity": 2
            },
            {
                "product_id": 613,
                "quantity": 1,
                "variations": {
                    "pa_color": "Black"
                }
            }
        ],
        "shipping_lines": [
            {
                "method_id": "flat_rate",
                "method_title": "Flat Rate",
                "total": "10.00"
            }
        ]
    }
}

print(wcapi.post("orders", data).json())
data = {
  order: {
    payment_details: {
      method_id: "bacs",
      method_title: "Direct Bank Transfer",
      paid: true
    },
    billing_address: {
      first_name: "John",
      last_name: "Doe",
      address_1: "969 Market",
      address_2: "",
      city: "San Francisco",
      state: "CA",
      postcode: "94103",
      country: "US",
      email: "john.doe@example.com",
      phone: "(555) 555-5555"
    },
    shipping_address: {
      first_name: "John",
      last_name: "Doe",
      address_1: "969 Market",
      address_2: "",
      city: "San Francisco",
      state: "CA",
      postcode: "94103",
      country: "US"
    },
    customer_id: 2,
    line_items: [
        {
          product_id: 546,
          quantity: 2
        },
        {
          product_id: 613,
          quantity: 1,
          variations: {
            pa_color: "Black"
          }
        }
    ],
    shipping_lines: [
        {
          method_id: "flat_rate",
          method_title: "Flat Rate",
          total: '10.00'
        }
    ]
  }
}

woocommerce.post("orders", data).parsed_response

JSON response example:

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

View an Order

This API lets you retrieve and view a specific order.

HTTP Request

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

JSON response example:

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

Available Filters

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.

HTTP Request

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

JSON response example:

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

Available Filters

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

This API lets you make changes to an order.

To remove a fee item, send the id of the item and name set to null.

HTTP Request

PUT
/wc-api/v3/orders/<id>
curl -X PUT https://example.com/wc-api/v3/orders/645 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "order": {
    "status": "completed"
  }
}'
var data = {
  order: {
    status: 'completed'
  }
};

WooCommerce.put('orders/645', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'order' => [
        'status' => 'completed'
    ]
];

print_r($woocommerce->put('orders/645', $data));
?>
data = {
    "order": {
        "status": "completed"
    }
}

print(wcapi.put("orders/645", data).json())
data = {
  order: {
    status: "completed"
  }
}

woocommerce.put("orders/645", data).parsed_response

JSON response example:

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

Create/Update Multiple Orders

This API helps you to bulk create/update multiple orders.

To update is necessary to send objects containing IDs and to create new not just send the ID.

HTTP Request

POST
/wc-api/v3/orders/bulk
curl -X POST https://example.com/wc-api/v3/orders/bulk \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "orders": [
    {
      "id": 645,
      "shipping_methods": "Local Delivery"
    },
    {
      "id": 644,
      "shipping_methods": "Local Delivery"
    }
  ]
}'
var data = {
  orders: [
    {
      id: 645,
      shipping_methods: 'Local Delivery'
    },
    {
      id: 644,
      shipping_methods: 'Local Delivery'
    }
  ]
};

WooCommerce.post('orders/bulk', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'orders' => [
        [
            'id' => 645,
            'shipping_methods' => 'Local Delivery'
        ],
        [
            'id' => 644,
            'shipping_methods' => 'Local Delivery'
        ]
    ]
];

print_r($woocommerce->post('orders/bulk', $data));
?>
data = {
    "orders": [
        {
            "id": 645,
            "shipping_methods": "Local Delivery"
        },
        {
            "id": 644,
            "shipping_methods": "Local Delivery"
        }
    ]
}

print(wcapi.post("orders/bulk", data).json())
data = {
  orders: [
    {
      id: 645,
      shipping_methods: "Local Delivery"
    },
    {
      id: 644,
      shipping_methods: "Local Delivery"
    }
  ]
}

woocommerce.post("orders/bulk", data).parsed_response

JSON response example:

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

Delete an Order

This API helps you delete an order.

HTTP Request

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

JSON response example:

{
  "message": "Permanently deleted order"
}

Parameters

Parameter Type Description
force string Use true whether to permanently delete the order, defaults to false. Note that permanently deleting the order will return HTTP 200 rather than HTTP 202.

View Orders Count

This API lets you retrieve a count of all orders.

HTTP Request

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

JSON response example:

{
  "count": 2
}

Available Filters

Filter Type Description
status string Orders by status. eg: processing or cancelled

View List of Order Statuses

This API lets you retrieve a list of orders statuses available.

HTTP Request

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

JSON response example:

{
  "order_statuses": {
    "pending": "Pending Payment",
    "processing": "Processing",
    "on-hold": "On Hold",
    "completed": "Completed",
    "cancelled": "Cancelled",
    "refunded": "Refunded",
    "failed": "Failed"
  }
}

Order - Notes

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

Order Notes Properties

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
curl -X POST https://example.com/wc-api/v3/orders/645/notes \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "order_note": {
    "note": "Order ok!!!"
  }
}'
var data = {
  order_note: {
    note: 'Order ok!!!'
  }
};

WooCommerce.post('orders/645/notes', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'order_note' => [
        'note' => 'Order ok!!!'
    ]
];

print_r($woocommerce->post('orders/645/notes', $data));
?>
data = {
    "order_note": {
        "note": "Order ok!!!"
    }
}

print(wcapi.post("orders/645/notes", data).json())
data = {
  order_note: {
    note: "Order ok!!!"
  }
}

woocommerce.post("orders/645/notes", data).parsed_response

JSON response example:

{
  "order_note": {
    "id": "416",
    "created_at": "2015-01-26T20:56:44Z",
    "note": "Order ok!!!",
    "customer_note": false
  }
}

View an Order Note

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

HTTP Request

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

JSON response example:

{
  "order_note": {
    "id": "416",
    "created_at": "2015-01-26T20:56:44Z",
    "note": "Order ok!!!",
    "customer_note": false
  }
}

View List of Notes From an Order

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

HTTP Request

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

JSON response example:

{
  "order_notes": [
    {
      "id": "416",
      "created_at": "2015-01-26T20:56:44Z",
      "note": "Order ok!!!",
      "customer_note": false
    },
    {
      "id": "415",
      "created_at": "2015-01-26T20:16:14Z",
      "note": "Order status changed from Processing to Completed.",
      "customer_note": false
    },
    {
      "id": "412",
      "created_at": "2015-01-26T20:00:21Z",
      "note": "Order item stock reduced successfully.",
      "customer_note": false
    },
    {
      "id": "411",
      "created_at": "2015-01-26T20:00:09Z",
      "note": "Order status changed from Pending Payment to Processing.",
      "customer_note": false
    }
  ]
}

Update an Order Note

This API lets you make changes to an order note.

HTTP Request

PUT
/wc-api/v3/orders/<id>/notes/<note_id>
curl -X PUT https://example.com/wc-api/v3/orders/645/notes/416 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "order_note": {
    "note": "Ok!"
  }
}'
var data = {
  order_note: {
    note: 'Ok!'
  }
};

WooCommerce.put('orders/645/notes/416', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'order_note' => [
        'note' => 'Ok!'
    ]
];

print_r($woocommerce->put('orders/645/notes/416', $data));
?>
data = {
    "order_note": {
        "note": "Ok!"
    }
}

print(wcapi.put("orders/645/notes/416", data).json())
data = {
  order_note: {
    note: "Ok!"
  }
}

woocommerce.put("orders/645/notes/416", data).parsed_response

JSON response example:

{
  "order_note": {
    "id": "416",
    "created_at": "2015-01-26T20:56:44Z",
    "note": "Ok!",
    "customer_note": false
  }
}

Delete an Order Note

This API helps you delete an order note.

HTTP Request

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

JSON response example:

{
  "message": "Permanently deleted order note"
}

Order - Refunds

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

Order Refunds Properties

Attribute Type Description
id integer Order note ID read-only
created_at string UTC DateTime when the order refund was created read-only
amount string Refund amount required
reason string Reason for refund
line_items array List of order items to refund. See Line Items Properties

Create a Refund For an Order

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

HTTP Request

POST
/wc-api/v3/orders/<id>/refunds
curl -X POST https://example.com/wc-api/v3/orders/645/refunds \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "order_refund": {
    "amount": 10
  }
}'
var data = {
  order_refund: {
    amount: 10
  }
};

WooCommerce.post('orders/645/refunds', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'order_refund' => [
        'amount' => 10
    ]
];

print_r($woocommerce->post('orders/645/refunds', $data));
?>
data = {
    "order_refund": {
        "amount": 10
    }
}

print(wcapi.post("orders/645/refunds", data).json())
data = {
  order_refund: {
    amount: 10
  }
}

woocommerce.post("orders/645/refunds", data).parsed_response

JSON response example:

{
  "order_refund": {
    "id": 649,
    "created_at": "2015-01-26T19:29:32Z",
    "amount": "10.00",
    "reason": "",
    "line_items": []
  }
}

View an Order Refund

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

HTTP Request

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

JSON response example:

{
  "order_refund": {
    "id": 649,
    "created_at": "2015-01-26T19:29:32Z",
    "amount": "10.00",
    "reason": "",
    "line_items": []
  }
}

View List of Refunds From an Order

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

HTTP Request

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

JSON response example:

{
  "order_refunds": [
    {
      "id": 649,
      "created_at": "2015-01-26T19:29:32Z",
      "amount": "10.00",
      "reason": "",
      "line_items": []
    },
    {
      "id": 647,
      "created_at": "2015-01-26T19:19:06Z",
      "amount": "21.99",
      "reason": "",
      "line_items": [
        {
          "id": 514,
          "subtotal": "-21.99",
          "subtotal_tax": "0.00",
          "total": "-21.99",
          "total_tax": "0.00",
          "price": "-21.99",
          "quantity": 1,
          "tax_class": "reduced-rate",
          "name": "Premium Quality",
          "product_id": 546,
          "sku": "",
          "meta": []
        },
        {
          "id": 515,
          "subtotal": "0.00",
          "subtotal_tax": "0.00",
          "total": "0.00",
          "total_tax": "0.00",
          "price": "0.00",
          "quantity": 0,
          "tax_class": null,
          "name": "Ship Your Idea",
          "product_id": 613,
          "sku": "",
          "meta": []
        }
      ]
    }
  ]
}

Update an Order Refund

This API lets you make changes to an order refund.

HTTP Request

PUT
/wc-api/v3/orders/<id>/refunds/<refund_id>
curl -X PUT https://example.com/wc-api/v3/orders/645/refunds/649 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "order_refund": {
    "reason": "Because was it necessary!"
  }
}'
var data = {
  order_refund: {
    reason: 'Because was it necessary!'
  }
};

WooCommerce.put('orders/645/refunds/649', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'order_refund' => [
        'reason' => 'Because was it necessary!'
    ]
];

print_r($woocommerce->put('orders/645/refunds/649', $data));
?>
data = {
    "order_refund": {
        "reason": "Because was it necessary!"
    }
}

print(wcapi.put("orders/645/refunds/649", data).json())
data = {
  order_refund: {
    reason: "Because was it necessary!"
  }
}

woocommerce.put("orders/645/refunds/649", data).parsed_response

JSON response example:

{
  "order_refund": {
    "id": 649,
    "created_at": "2015-01-26T19:29:32Z",
    "amount": "10.00",
    "reason": "Because was it necessary!",
    "line_items": []
  }
}

Delete an Order Refund

This API helps you delete an order refund.

HTTP Request

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

JSON response example:

{
  "message": "Permanently deleted refund"
}

Products

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

Products Properties

Attribute Type Description
title string Product name
id integer Product ID (post ID) read-only
name string Product slug edit-only
created_at string UTC DateTime when the product was created read-only
updated_at string UTC DateTime when the product was last updated read-only
type string Product type. By default in WooCommerce the following types are available: simple, grouped, external, variable. Default is simple
status string Product status (post status). Default is publish
downloadable boolean If the product is downloadable or not. Downloadable products give access to a file upon purchase
virtual boolean If the product is virtual or not. Virtual products are intangible and aren't shipped
permalink string Product URL (post permalink) read-only
sku string SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased
price string Current product price. This is setted from regular_price and sale_price read-only
regular_price string Product regular price
sale_price string Product sale price
sale_price_dates_from string Sets the sale start date. Date in the YYYY-MM-DD format write-only
sale_price_dates_to string Sets the sale end date. Date in the YYYY-MM-DD format write-only
price_html string Price formatted in HTML, e.g. <del><span class=\"amount\">&#36;&nbsp;3.00</span></del> <ins><span class=\"amount\">&#36;&nbsp;2.00</span></ins> read-only
taxable boolean Show if the product is taxable or not read-only
tax_status string Tax status. The options are: taxable, shipping (Shipping only) and none
tax_class string Tax class
managing_stock boolean Enable stock management at product level
stock_quantity integer Stock quantity. If is a variable product this value will be used to control stock for all variations, unless you define stock at variation level.
in_stock boolean Controls whether or not the product is listed as "in stock" or "out of stock" on the frontend.
backorders_allowed boolean Shows if backorders are allowed read-only
backordered boolean Shows if a product is on backorder (if the product have the stock_quantity negative) read-only
backorders mixed If managing stock, this controls whether or not backorders are allowed. If enabled, stock quantity can go below 0. The options are: false (Do not allow), notify (Allow, but notify customer), and true (Allow) write-only
sold_individually boolean When true this only allow one item to be bought in a single order
purchaseable boolean Shows if the product can be bought read-only
featured boolean Featured Product
visible boolean Shows whether or not the product is visible in the catalog read-only
catalog_visibility string Catalog visibility. The following options are available: visible (Catalog and search), catalog (Only in catalog), search (Only in search) and hidden (Hidden from all). Default is visible
on_sale boolean Shows if the product is on sale or not read-only
weight string Product weight in decimal format
dimensions array List of the product dimensions. See Dimensions Properties
shipping_required boolean Shows if the product need to be shipped or not read-only
shipping_taxable boolean Shows whether or not the product shipping is taxable read-only
shipping_class string Shipping class slug. Shipping classes are used by certain shipping methods to group similar products
shipping_class_id integer Shipping class ID read-only
description string Product description
enable_html_description bool Enable HTML for product description write-only
short_description string Product short description
enable_html_short_description string Enable HTML for product short description write-only
reviews_allowed boolean Shows/define if reviews are allowed
average_rating string Reviews average rating read-only
rating_count integer Amount of reviews that the product have read-only
related_ids array List of related products IDs (integer) read-only
upsell_ids array List of up-sell products IDs (integer). Up-sells are products which you recommend instead of the currently viewed product, for example, products that are more profitable or better quality or more expensive
cross_sell_ids array List of cross-sell products IDs. Cross-sells are products which you promote in the cart, based on the current product
parent_id integer Product parent ID (post_parent)
categories array List of product categories names (string). In write-mode need to pass a array of categories IDs (integer) (uses wp_set_object_terms())
tags array List of product tags names (string). In write-mode need to pass a array of tags IDs (integer) (uses wp_set_object_terms())
images array List of products images. See Images Properties
featured_src string Featured image URL read-only
attributes array List of product attributes. See Attributes Properties. Note: the attribute must be registered in WooCommerce before.
default_attributes array Defaults variation attributes. These are the attributes that will be pre-selected on the frontend. See Default Attributes Properties write-only
downloads array List of downloadable files. See Downloads Properties
download_limit integer Amount of times the product 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 product. In write-mode you can sent a blank string for never expiry. e.g ''
download_type string Download type, this controls the schema. The available options are: '' (Standard Product), application (Application/Software) and music (Music)
purchase_note string Optional note to send the customer after purchase.
total_sales integer Amount of sales read-only
variations array List of products variations. See Variations Properties
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

Attribute Type Description
length string Product length in decimal format
width string Product width in decimal format
height string Product height in decimal format
unit string Product name read-only

Images Properties

Attribute Type Description
id integer Image ID (attachment ID)
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)
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
name string Attribute name required
slug string Attribute slug
position integer Attribute position
visible boolean Shows/define if the attribute is visible on the "Additional Information" tab in the product's page
variation boolean Shows/define if the attribute can be used as variation
options array List of available term names of the attribute

Default Attributes Properties

Attribute Type Description
name string Attribute name
slug string Attribute slug
option string Selected term name of the attribute

Downloads Properties

Attribute Type Description
id string File ID (File ID) read-only
name string File name
file string File URL. In write-mode you can use this property to send new files

Variations Properties

Attribute Type Description
id integer Variation ID (post ID) read-only
created_at string UTC DateTime when the variation was created read-only
updated_at string UTC DateTime when the variation was last updated read-only
downloadable boolean If the variation is downloadable or not. Downloadable variations give access to a file upon purchase
virtual boolean If the variation is virtual or not. Virtual variations are intangible and aren't shipped
permalink string Variation URL (post permalink) read-only
sku string SKU refers to a Stock-keeping unit, a unique identifier for each distinct product and service that can be purchased
price string Current variation price. This is setted from regular_price and sale_price read-only
regular_price string Variation regular price
sale_price string Variation sale price
sale_price_dates_from string Sets the sale start date. Date in the YYYY-MM-DD format write-only
sale_price_dates_to string Sets the sale end date. Date in the YYYY-MM-DD format write-only
taxable boolean Show if the variation is taxable or not read-only
tax_status string Tax status. The options are: taxable, shipping (Shipping only) and none
tax_class string Tax class
managing_stock boolean Enable stock management at variation level
stock_quantity integer Stock quantity. If is a variable variation this value will be used to control stock for all variations, unless you define stock at variation level.
in_stock boolean Controls whether or not the variation is listed as "in stock" or "out of stock" on the frontend.
backordered boolean Shows if a variation is on backorder (if the variation have the stock_quantity negative) read-only
purchaseable boolean Shows if the variation can be bought read-only
visible boolean Shows whether or not the product parent is visible in the catalog read-only
on_sale boolean Shows if the variation is on sale or not read-only
weight string Variation weight in decimal format
dimensions array List of the variation dimensions. See Dimensions Properties
shipping_class string Shipping class slug. Shipping classes are used by certain shipping methods to group similar products
shipping_class_id integer Shipping class ID read-only
image array Variation featured image. Only position 0 will be used. See Images Properties
attributes array List of variation attributes. Similar to a simple or variable product, but for variation indicate the attributes used to form the variation. See Attributes Properties
downloads array List of downloadable files. See Downloads Properties
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

This API helps you to create a new product.

HTTP Request

POST
/wc-api/v3/products

Example of how to create a simple product:

curl -X POST https://example.com/wc-api/v3/products \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product": {
    "title": "Premium Quality",
    "type": "simple",
    "regular_price": "21.99",
    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
    "categories": [
      9,
      14
    ],
    "images": [
      {
        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
        "position": 0
      },
      {
        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
        "position": 1
      }
    ]
  }
}'
var data = {
  product: {
    title: 'Premium Quality',
    type: 'simple',
    regular_price: '21.99',
    description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
    short_description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
    categories: [
      9,
      14
    ],
    images: [
      {
        src: 'http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
        position: 0
      },
      {
        src: 'http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg',
        position: 1
      }
    ]
  }
};

WooCommerce.post('products', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product' => [
        'title' => 'Premium Quality',
        'type' => 'simple',
        'regular_price' => '21.99',
        'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
        'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
        'categories' => [
            9,
            14
        ],
        'images' => [
            [
                'src' => 'http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg',
                'position' => 0
            ],
            [
                'src' => 'http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg',
                'position' => 1
            ]
        ]
    ]
];

print_r($woocommerce->post('products', $data));
?>
data = {
    "product": {
        "title": "Premium Quality",
        "type": "simple",
        "regular_price": "21.99",
        "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
        "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
        "categories": [
            9,
            14
        ],
        "images": [
            {
                "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
                "position": 0
            },
            {
                "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
                "position": 1
            }
        ]
    }
}

print(wcapi.post("products", data).json())
data = {
  product: {
    title: "Premium Quality",
    type: "simple",
    regular_price: "21.99",
    description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
    short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
    categories: [
      9,
      14
    ],
    images: [
      {
        src: "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
        position: 0
      },
      {
        src: "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
        position: 1
      }
    ]
  }
}

woocommerce.post("products", data).parsed_response

JSON response example:

{
  "product": {
    "title": "Premium Quality",
    "id": 546,
    "created_at": "2015-01-22T19:46:16Z",
    "updated_at": "2015-01-22T19:46:16Z",
    "type": "simple",
    "status": "publish",
    "downloadable": false,
    "virtual": false,
    "permalink": "https://example.com/product/premium-quality/",
    "sku": "",
    "price": "21.99",
    "regular_price": "21.99",
    "sale_price": null,
    "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
    "taxable": true,
    "tax_status": "taxable",
    "tax_class": "",
    "managing_stock": false,
    "stock_quantity": 0,
    "in_stock": true,
    "backorders_allowed": false,
    "backordered": false,
    "sold_individually": false,
    "purchaseable": true,
    "featured": false,
    "visible": true,
    "catalog_visibility": "visible",
    "on_sale": false,
    "weight": null,
    "dimensions": {
      "length": "",
      "width": "",
      "height": "",
      "unit": "cm"
    },
    "shipping_required": true,
    "shipping_taxable": true,
    "shipping_class": "",
    "shipping_class_id": null,
    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
    "reviews_allowed": true,
    "average_rating": "0.00",
    "rating_count": 0,
    "related_ids": [
      37,
      47,
      31,
      19,
      22
    ],
    "upsell_ids": [],
    "cross_sell_ids": [],
    "parent_id": 0,
    "categories": [
      "Clothing",
      "T-shirts"
    ],
    "tags": [],
    "images": [
      {
        "id": 547,
        "created_at": "2015-01-22T19:46:16Z",
        "updated_at": "2015-01-22T19:46:16Z",
        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
        "title": "",
        "alt": "",
        "position": 0
      },
      {
        "id": 548,
        "created_at": "2015-01-22T19:46:17Z",
        "updated_at": "2015-01-22T19:46:17Z",
        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
        "title": "",
        "alt": "",
        "position": 1
      }
    ],
    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
    "attributes": [],
    "downloads": [],
    "download_limit": 0,
    "download_expiry": 0,
    "download_type": "",
    "purchase_note": "",
    "total_sales": 0,
    "variations": [],
    "parent": [],
    "grouped_products": [],
    "menu_order": 0
  }
}

Example of how to create a variable product:

curl -X POST https://example.com/wc-api/v3/products \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product": {
    "title": "Ship Your Idea",
    "type": "variable",
    "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
    "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
    "categories": [
      9,
      14
    ],
    "images": [
      {
        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
        "position": 0
      },
      {
        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
        "position": 1
      },
      {
        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
        "position": 2
      },
      {
        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
        "position": 3
      }
    ],
    "attributes": [
      {
        "name": "Color",
        "slug": "color",
        "position": "0",
        "visible": false,
        "variation": true,
        "options": [
          "Black",
          "Green"
        ]
      }
    ],
    "default_attributes": [
      {
        "name": "Color",
        "slug": "color",
        "option": "Black"
      }
    ],
    "variations": [
      {
        "regular_price": "19.99",
        "image": [
          {
            "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
            "position": 0
          }
        ],
        "attributes": [
          {
            "name": "Color",
            "slug": "color",
            "option": "black"
          }
        ]
      },
      {
        "regular_price": "19.99",
        "image": [
          {
            "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
            "position": 0
          }
        ],
        "attributes": [
          {
            "name": "Color",
            "slug": "color",
            "option": "green"
          }
        ]
      }
    ]
  }
}'
var data = {
  product: {
    title: 'Ship Your Idea',
    type: 'variable',
    description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
    short_description: 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
    categories: [
      9,
      14
    ],
    images: [
      {
        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
        position: 0
      },
      {
        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg',
        position: 1
      },
      {
        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
        position: 2
      },
      {
        src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg',
        position: 3
      }
    ],
    attributes: [
      {
        name: 'Color',
        slug: 'color',
        position: '0',
        visible: false,
        variation: true,
        options: [
          'Black',
          'Green'
        ]
      }
    ],
    default_attributes: [
      {
        name: 'Color',
        slug: 'color',
        option: 'Black'
      }
    ],
    variations: [
      {
        regular_price: '19.99',
        image: [
          {
            src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
            position: 0
          }
        ],
        attributes: [
          {
            name: 'Color',
            slug: 'color',
            option: 'black'
          }
        ]
      },
      {
        regular_price: '19.99',
        image: [
          {
            src: 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
            position: 0
          }
        ],
        attributes: [
          {
            name: 'Color',
            slug: 'color',
            option: 'green'
          }
        ]
      }
    ]
  }
};

WooCommerce.post('products', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product' => [
        'title' => 'Ship Your Idea',
        'type' => 'variable',
        'description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.',
        'short_description' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.',
        'categories' => [
            9,
            14
        ],
        'images' => [
            [
                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
                'position' => 0
            ],
            [
                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg',
                'position' => 1
            ],
            [
                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
                'position' => 2
            ],
            [
                'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg',
                'position' => 3
            ]
        ],
        'attributes' => [
            [
                'name' => 'Color',
                'slug' => 'color',
                'position' => '0',
                'visible' => false,
                'variation' => true,
                'options' => [
                    'Black',
                    'Green'
                ]
            ]
        ],
        'default_attributes' => [
            [
                'name' => 'Color',
                'slug' => 'color',
                'option' => 'Black'
            ]
        ],
        'variations' => [
            [
                'regular_price' => '19.99',
                'image' => [
                    [
                        'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg',
                        'position' => 0
                    ]
                ],
                'attributes' => [
                    [
                        'name' => 'Color',
                        'slug' => 'color',
                        'option' => 'black'
                    ]
                ]
            ],
            [
                'regular_price' => '19.99',
                'image' => [
                    [
                        'src' => 'http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg',
                        'position' => 0
                    ]
                ],
                'attributes' => [
                    [
                        'name' => 'Color',
                        'slug' => 'color',
                        'option' => 'green'
                    ]
                ]
            ]
        ]
    ]
];

print_r($woocommerce->post('products', $data));
?>
data = {
    "product": {
        "title": "Ship Your Idea",
        "type": "variable",
        "description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
        "short_description": "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
        "categories": [
            9,
            14
        ],
        "images": [
            {
                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
                "position": 0
            },
            {
                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
                "position": 1
            },
            {
                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
                "position": 2
            },
            {
                "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
                "position": 3
            }
        ],
        "attributes": [
            {
                "name": "Color",
                "slug": "color",
                "position": "0",
                "visible": False,
                "variation": True,
                "options": [
                    "Black",
                    "Green"
                ]
            }
        ],
        "default_attributes": [
            {
                "name": "Color",
                "slug": "color",
                "option": "Black"
            }
        ],
        "variations": [
            {
                "regular_price": "19.99",
                "image": [
                    {
                        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
                        "position": 0
                    }
                ],
                "attributes": [
                    {
                        "name": "Color",
                        "slug": "color",
                        "option": "black"
                    }
                ]
            },
            {
                "regular_price": "19.99",
                "image": [
                    {
                        "src": "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
                        "position": 0
                    }
                ],
                "attributes": [
                    {
                        "name": "Color",
                        "slug": "color",
                        "option": "green"
                    }
                ]
            }
        ]
    }
}

print(wcapi.post("products", data).json())
data = {
  product: {
    title: "Ship Your Idea",
    type: "variable",
    description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.",
    short_description: "Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.",
    categories: [
      9,
      14
    ],
    images: [
      {
        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
        position: 0
      },
      {
        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
        position: 1
      },
      {
        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
        position: 2
      },
      {
        src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
        position: 3
      }
    ],
    attributes: [
      {
        name: "Color",
        slug: "color",
        position: "0",
        visible: false,
        variation: true,
        options: [
          "Black",
          "Green"
        ]
      }
    ],
    default_attributes: [
      {
        name: "Color",
        slug: "color",
        option: "Black"
      }
    ],
    variations: [
      {
        regular_price: "19.99",
        image: [
          {
            src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
            position: 0
          }
        ],
        attributes: [
          {
            name: "Color",
            slug: "color",
            option: "black"
          }
        ]
      },
      {
        regular_price: "19.99",
        image: [
          {
            src: "http://example.com/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
            position: 0
          }
        ],
        attributes: [
          {
            name: "Color",
            slug: "color",
            option: "green"
          }
        ]
      }
    ]
  }
}

woocommerce.post("products", data).parsed_response

JSON response example:

{
  "product": {
    "title": "Ship Your Idea",
    "id": 604,
    "created_at": "2015-01-22T20:37:14Z",
    "updated_at": "2015-01-22T20:37:14Z",
    "type": "variable",
    "status": "publish",
    "downloadable": false,
    "virtual": false,
    "permalink": "https://example/product/ship-your-idea/",
    "sku": "",
    "price": "19.99",
    "regular_price": "0.00",
    "sale_price": null,
    "price_html": "<span class=\"amount\">&#36;&nbsp;19.99</span>",
    "taxable": true,
    "tax_status": "taxable",
    "tax_class": "",
    "managing_stock": false,
    "stock_quantity": 0,
    "in_stock": true,
    "backorders_allowed": false,
    "backordered": false,
    "sold_individually": false,
    "purchaseable": true,
    "featured": false,
    "visible": true,
    "catalog_visibility": "visible",
    "on_sale": false,
    "weight": null,
    "dimensions": {
      "length": "",
      "width": "",
      "height": "",
      "unit": "cm"
    },
    "shipping_required": true,
    "shipping_taxable": true,
    "shipping_class": "",
    "shipping_class_id": null,
    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
    "reviews_allowed": true,
    "average_rating": "0.00",
    "rating_count": 0,
    "related_ids": [
      40,
      37,
      47,
      577,
      34
    ],
    "upsell_ids": [],
    "cross_sell_ids": [],
    "parent_id": 0,
    "categories": [
      "Clothing",
      "T-shirts"
    ],
    "tags": [],
    "images": [
      {
        "id": 605,
        "created_at": "2015-01-22T20:37:14Z",
        "updated_at": "2015-01-22T20:37:14Z",
        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
        "title": "",
        "alt": "",
        "position": 0
      },
      {
        "id": 606,
        "created_at": "2015-01-22T20:37:15Z",
        "updated_at": "2015-01-22T20:37:15Z",
        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
        "title": "",
        "alt": "",
        "position": 1
      },
      {
        "id": 607,
        "created_at": "2015-01-22T20:37:15Z",
        "updated_at": "2015-01-22T20:37:15Z",
        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
        "title": "",
        "alt": "",
        "position": 2
      },
      {
        "id": 608,
        "created_at": "2015-01-22T20:37:16Z",
        "updated_at": "2015-01-22T20:37:16Z",
        "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
        "title": "",
        "alt": "",
        "position": 3
      }
    ],
    "featured_src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
    "attributes": [
      {
        "name": "Color",
        "slug": "color",
        "position": 0,
        "visible": false,
        "variation": true,
        "options": [
          "Black",
          "Green"
        ]
      }
    ],
    "downloads": [],
    "download_limit": 0,
    "download_expiry": 0,
    "download_type": "",
    "purchase_note": "",
    "total_sales": 0,
    "variations": [
      {
        "id": 609,
        "created_at": "2015-01-22T20:37:14Z",
        "updated_at": "2015-01-22T20:37:14Z",
        "downloadable": false,
        "virtual": false,
        "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=black",
        "sku": "",
        "price": "19.99",
        "regular_price": "19.99",
        "sale_price": null,
        "taxable": true,
        "tax_status": "taxable",
        "tax_class": "",
        "managing_stock": false,
        "stock_quantity": 0,
        "in_stock": true,
        "backordered": false,
        "purchaseable": true,
        "visible": true,
        "on_sale": false,
        "weight": null,
        "dimensions": {
          "length": "",
          "width": "",
          "height": "",
          "unit": "cm"
        },
        "shipping_class": "",
        "shipping_class_id": null,
        "image": [
          {
            "id": 610,
            "created_at": "2015-01-22T20:37:18Z",
            "updated_at": "2015-01-22T20:37:18Z",
            "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
            "title": "",
            "alt": "",
            "position": 0
          }
        ],
        "attributes": [
          {
            "name": "Color",
            "slug": "color",
            "option": "black"
          }
        ],
        "downloads": [],
        "download_limit": 0,
        "download_expiry": 0
      },
      {
        "id": 611,
        "created_at": "2015-01-22T20:37:14Z",
        "updated_at": "2015-01-22T20:37:14Z",
        "downloadable": false,
        "virtual": false,
        "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=green",
        "sku": "",
        "price": "19.99",
        "regular_price": "19.99",
        "sale_price": null,
        "taxable": true,
        "tax_status": "taxable",
        "tax_class": "",
        "managing_stock": false,
        "stock_quantity": 0,
        "in_stock": true,
        "backordered": false,
        "purchaseable": true,
        "visible": true,
        "on_sale": false,
        "weight": null,
        "dimensions": {
          "length": "",
          "width": "",
          "height": "",
          "unit": "cm"
        },
        "shipping_class": "",
        "shipping_class_id": null,
        "image": [
          {
            "id": 612,
            "created_at": "2015-01-22T20:37:19Z",
            "updated_at": "2015-01-22T20:37:19Z",
            "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
            "title": "",
            "alt": "",
            "position": 0
          }
        ],
        "attributes": [
          {
            "name": "Color",
            "slug": "color",
            "option": "green"
          }
        ],
        "downloads": [],
        "download_limit": 0,
        "download_expiry": 0
      }
    ],
    "parent": [],
    "grouped_products": [],
    "menu_order": 0
  }
}

View a Product

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

HTTP Request

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

JSON response example:

{
  "product": {
    "title": "Premium Quality",
    "id": 546,
    "created_at": "2015-01-22T19:46:16Z",
    "updated_at": "2015-01-22T19:46:16Z",
    "type": "simple",
    "status": "publish",
    "downloadable": false,
    "virtual": false,
    "permalink": "https://example.com/product/premium-quality/",
    "sku": "",
    "price": "21.99",
    "regular_price": "21.99",
    "sale_price": null,
    "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
    "taxable": true,
    "tax_status": "taxable",
    "tax_class": "",
    "managing_stock": false,
    "stock_quantity": 0,
    "in_stock": true,
    "backorders_allowed": false,
    "backordered": false,
    "sold_individually": false,
    "purchaseable": true,
    "featured": false,
    "visible": true,
    "catalog_visibility": "visible",
    "on_sale": false,
    "weight": null,
    "dimensions": {
      "length": "",
      "width": "",
      "height": "",
      "unit": "cm"
    },
    "shipping_required": true,
    "shipping_taxable": true,
    "shipping_class": "",
    "shipping_class_id": null,
    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
    "reviews_allowed": true,
    "average_rating": "0.00",
    "rating_count": 0,
    "related_ids": [
      37,
      47,
      31,
      19,
      22
    ],
    "upsell_ids": [],
    "cross_sell_ids": [],
    "parent_id": 0,
    "categories": [
      "Clothing",
      "T-shirts"
    ],
    "tags": [],
    "images": [
      {
        "id": 547,
        "created_at": "2015-01-22T19:46:16Z",
        "updated_at": "2015-01-22T19:46:16Z",
        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
        "title": "",
        "alt": "",
        "position": 0
      },
      {
        "id": 548,
        "created_at": "2015-01-22T19:46:17Z",
        "updated_at": "2015-01-22T19:46:17Z",
        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
        "title": "",
        "alt": "",
        "position": 1
      }
    ],
    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
    "attributes": [],
    "downloads": [],
    "download_limit": 0,
    "download_expiry": 0,
    "download_type": "",
    "purchase_note": "",
    "total_sales": 0,
    "variations": [],
    "parent": [],
    "grouped_products": [],
    "menu_order": 0
  }
}

View List of Products

This API helps you to view all the products.

HTTP Request

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

JSON response example:

{
  "products": [
    {
      "title": "Premium Quality",
      "id": 546,
      "created_at": "2015-01-22T19:46:16Z",
      "updated_at": "2015-01-22T19:46:16Z",
      "type": "simple",
      "status": "publish",
      "downloadable": false,
      "virtual": false,
      "permalink": "https://example.com/product/premium-quality/",
      "sku": "",
      "price": "21.99",
      "regular_price": "21.99",
      "sale_price": null,
      "price_html": "<span class=\"amount\">&#36;&nbsp;21.99</span>",
      "taxable": true,
      "tax_status": "taxable",
      "tax_class": "",
      "managing_stock": false,
      "stock_quantity": 0,
      "in_stock": true,
      "backorders_allowed": false,
      "backordered": false,
      "sold_individually": false,
      "purchaseable": true,
      "featured": false,
      "visible": true,
      "catalog_visibility": "visible",
      "on_sale": false,
      "weight": null,
      "dimensions": {
        "length": "",
        "width": "",
        "height": "",
        "unit": "cm"
      },
      "shipping_required": true,
      "shipping_taxable": true,
      "shipping_class": "",
      "shipping_class_id": null,
      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
      "reviews_allowed": true,
      "average_rating": "0.00",
      "rating_count": 0,
      "related_ids": [
        37,
        47,
        31,
        19,
        22
      ],
      "upsell_ids": [],
      "cross_sell_ids": [],
      "parent_id": 0,
      "categories": [
        "Clothing",
        "T-shirts"
      ],
      "tags": [],
      "images": [
        {
          "id": 547,
          "created_at": "2015-01-22T19:46:16Z",
          "updated_at": "2015-01-22T19:46:16Z",
          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
          "title": "",
          "alt": "",
          "position": 0
        },
        {
          "id": 548,
          "created_at": "2015-01-22T19:46:17Z",
          "updated_at": "2015-01-22T19:46:17Z",
          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
          "title": "",
          "alt": "",
          "position": 1
        }
      ],
      "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
      "attributes": [],
      "downloads": [],
      "download_limit": 0,
      "download_expiry": 0,
      "download_type": "",
      "purchase_note": "",
      "total_sales": 0,
      "variations": [],
      "parent": [],
      "grouped_products": [],
      "menu_order": 0
    },
    {
      "title": "Ship Your Idea",
      "id": 604,
      "created_at": "2015-01-22T20:37:14Z",
      "updated_at": "2015-01-22T20:37:14Z",
      "type": "variable",
      "status": "publish",
      "downloadable": false,
      "virtual": false,
      "permalink": "https://example/product/ship-your-idea/",
      "sku": "",
      "price": "19.99",
      "regular_price": "0.00",
      "sale_price": null,
      "price_html": "<span class=\"amount\">&#36;&nbsp;19.99</span>",
      "taxable": true,
      "tax_status": "taxable",
      "tax_class": "",
      "managing_stock": false,
      "stock_quantity": 0,
      "in_stock": true,
      "backorders_allowed": false,
      "backordered": false,
      "sold_individually": false,
      "purchaseable": true,
      "featured": false,
      "visible": true,
      "catalog_visibility": "visible",
      "on_sale": false,
      "weight": null,
      "dimensions": {
        "length": "",
        "width": "",
        "height": "",
        "unit": "cm"
      },
      "shipping_required": true,
      "shipping_taxable": true,
      "shipping_class": "",
      "shipping_class_id": null,
      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
      "reviews_allowed": true,
      "average_rating": "0.00",
      "rating_count": 0,
      "related_ids": [
        40,
        37,
        47,
        577,
        34
      ],
      "upsell_ids": [],
      "cross_sell_ids": [],
      "parent_id": 0,
      "categories": [
        "Clothing",
        "T-shirts"
      ],
      "tags": [],
      "images": [
        {
          "id": 605,
          "created_at": "2015-01-22T20:37:14Z",
          "updated_at": "2015-01-22T20:37:14Z",
          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
          "title": "",
          "alt": "",
          "position": 0
        },
        {
          "id": 606,
          "created_at": "2015-01-22T20:37:15Z",
          "updated_at": "2015-01-22T20:37:15Z",
          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
          "title": "",
          "alt": "",
          "position": 1
        },
        {
          "id": 607,
          "created_at": "2015-01-22T20:37:15Z",
          "updated_at": "2015-01-22T20:37:15Z",
          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
          "title": "",
          "alt": "",
          "position": 2
        },
        {
          "id": 608,
          "created_at": "2015-01-22T20:37:16Z",
          "updated_at": "2015-01-22T20:37:16Z",
          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
          "title": "",
          "alt": "",
          "position": 3
        }
      ],
      "featured_src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
      "attributes": [
        {
          "name": "Color",
          "slug": "color",
          "position": 0,
          "visible": false,
          "variation": true,
          "options": [
            "Black",
            "Green"
          ]
        }
      ],
      "downloads": [],
      "download_limit": 0,
      "download_expiry": 0,
      "download_type": "",
      "purchase_note": "",
      "total_sales": 0,
      "variations": [
        {
          "id": 609,
          "created_at": "2015-01-22T20:37:14Z",
          "updated_at": "2015-01-22T20:37:14Z",
          "downloadable": false,
          "virtual": false,
          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=black",
          "sku": "",
          "price": "19.99",
          "regular_price": "19.99",
          "sale_price": null,
          "taxable": true,
          "tax_status": "taxable",
          "tax_class": "",
          "managing_stock": false,
          "stock_quantity": 0,
          "in_stock": true,
          "backordered": false,
          "purchaseable": true,
          "visible": true,
          "on_sale": false,
          "weight": null,
          "dimensions": {
            "length": "",
            "width": "",
            "height": "",
            "unit": "cm"
          },
          "shipping_class": "",
          "shipping_class_id": null,
          "image": [
            {
              "id": 610,
              "created_at": "2015-01-22T20:37:18Z",
              "updated_at": "2015-01-22T20:37:18Z",
              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
              "title": "",
              "alt": "",
              "position": 0
            }
          ],
          "attributes": [
            {
              "name": "Color",
              "slug": "color",
              "option": "black"
            }
          ],
          "downloads": [],
          "download_limit": 0,
          "download_expiry": 0
        },
        {
          "id": 611,
          "created_at": "2015-01-22T20:37:14Z",
          "updated_at": "2015-01-22T20:37:14Z",
          "downloadable": false,
          "virtual": false,
          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=green",
          "sku": "",
          "price": "19.99",
          "regular_price": "19.99",
          "sale_price": null,
          "taxable": true,
          "tax_status": "taxable",
          "tax_class": "",
          "managing_stock": false,
          "stock_quantity": 0,
          "in_stock": true,
          "backordered": false,
          "purchaseable": true,
          "visible": true,
          "on_sale": false,
          "weight": null,
          "dimensions": {
            "length": "",
            "width": "",
            "height": "",
            "unit": "cm"
          },
          "shipping_class": "",
          "shipping_class_id": null,
          "image": [
            {
              "id": 612,
              "created_at": "2015-01-22T20:37:19Z",
              "updated_at": "2015-01-22T20:37:19Z",
              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
              "title": "",
              "alt": "",
              "position": 0
            }
          ],
          "attributes": [
            {
              "name": "Color",
              "slug": "color",
              "option": "green"
            }
          ],
          "downloads": [],
          "download_limit": 0,
          "download_expiry": 0
        }
      ],
      "parent": [],
      "grouped_products": [],
      "menu_order": 0
    }
  ]
}

Available Filters

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

This API lets you make changes to a product.

HTTP Request

PUT
/wc-api/v3/products/<id>
curl -X PUT https://example.com/wc-api/v3/products/546 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product": {
    "regular_price": "24.54"
  }
}'
var data = {
  product: {
    regular_price: '24.54'
  }
};

WooCommerce.put('products/546', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product' => [
        'regular_price' => '24.54'
    ]
];

print_r($woocommerce->put('products/546', $data));
?>
data = {
    "product": {
        "regular_price": "24.54"
    }
}

print(wcapi.put("products/546", data).json())
data = {
  product: {
    regular_price: "24.54"
  }
}

woocommerce.put("products/546", data).parsed_response

JSON response example:

{
  "product": {
    "title": "Premium Quality",
    "id": 546,
    "created_at": "2015-01-22T19:46:16Z",
    "updated_at": "2015-01-22T19:55:31Z",
    "type": "simple",
    "status": "publish",
    "downloadable": false,
    "virtual": false,
    "permalink": "https://example.com/product/premium-quality/",
    "sku": "",
    "price": "24.54",
    "regular_price": "24.54",
    "sale_price": null,
    "price_html": "<span class=\"amount\">&#36;&nbsp;24.54</span>",
    "taxable": true,
    "tax_status": "taxable",
    "tax_class": "",
    "managing_stock": false,
    "stock_quantity": 0,
    "in_stock": true,
    "backorders_allowed": false,
    "backordered": false,
    "sold_individually": false,
    "purchaseable": true,
    "featured": false,
    "visible": true,
    "catalog_visibility": "visible",
    "on_sale": false,
    "weight": null,
    "dimensions": {
      "length": "",
      "width": "",
      "height": "",
      "unit": "cm"
    },
    "shipping_required": true,
    "shipping_taxable": true,
    "shipping_class": "",
    "shipping_class_id": null,
    "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
    "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
    "reviews_allowed": true,
    "average_rating": "0.00",
    "rating_count": 0,
    "related_ids": [
      37,
      47,
      31,
      19,
      22
    ],
    "upsell_ids": [],
    "cross_sell_ids": [],
    "parent_id": 0,
    "categories": [
      "Clothing",
      "T-shirts"
    ],
    "tags": [],
    "images": [
      {
        "id": 547,
        "created_at": "2015-01-22T19:46:16Z",
        "updated_at": "2015-01-22T19:46:16Z",
        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
        "title": "",
        "alt": "",
        "position": 0
      },
      {
        "id": 548,
        "created_at": "2015-01-22T19:46:17Z",
        "updated_at": "2015-01-22T19:46:17Z",
        "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
        "title": "",
        "alt": "",
        "position": 1
      }
    ],
    "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
    "attributes": [],
    "downloads": [],
    "download_limit": 0,
    "download_expiry": 0,
    "download_type": "",
    "purchase_note": "",
    "total_sales": 0,
    "variations": [],
    "parent": [],
    "grouped_products": [],
    "menu_order": 0
  }
}

Create/Update Multiple Products

This API helps you to bulk create/update multiple products.

To update is necessary to send objects containing IDs and to create new not just send the ID.

HTTP Request

POST
/wc-api/v3/products/bulk
curl -X POST https://example.com/wc-api/v3/products/bulk \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "products": [
    {
      "id": 546,
      "regular_price": "29.99"
    },
    {
      "id": 604,
      "variations": [
        {
          "id": 609,
          "regular_price": "29.99"
        },
        {
          "id": 611,
          "regular_price": "29.99"
        }
      ]
    }
  ]
}'
var data = {
  products: [
    {
      id: 546,
      regular_price: '29.99'
    },
    {
      id: 604,
      variations: [
        {
          id: 609,
          regular_price: '29.99'
        },
        {
          id: 611,
          regular_price: '29.99'
        }
      ]
    }
  ]
};

WooCommerce.post('products/bulk', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'products' => [
        [
            'id' => 546,
            'regular_price' => '29.99'
        ],
        [
            'id' => 604,
            'variations' => [
                [
                    'id' => 609,
                    'regular_price' => '29.99'
                ],
                [
                    'id' => 611,
                    'regular_price' => '29.99'
                ]
            ]
        ]
    ]
];

print_r($woocommerce->post('products/bulk', $data));
?>
data = {
    "products": [
        {
            "id": 546,
            "regular_price": "29.99"
        },
        {
            "id": 604,
            "variations": [
                {
                    "id": 609,
                    "regular_price": "29.99"
                },
                {
                    "id": 611,
                    "regular_price": "29.99"
                }
            ]
        }
    ]
}

print(wcapi.post("products/bulk", data).json())
data = {
  products: [
    {
      id: 546,
      regular_price: "29.99"
    },
    {
      id: 604,
      variations: [
        {
          id: 609,
          regular_price: "29.99"
        },
        {
          id: 611,
          regular_price: "29.99"
        }
      ]
    }
  ]
}

woocommerce.post("products/bulk", data).parsed_response

JSON response example:

{
  "products": [
    {
      "title": "Premium Quality",
      "id": 546,
      "created_at": "2015-01-22T19:46:16Z",
      "updated_at": "2015-07-27T14:22:32Z",
      "type": "simple",
      "status": "publish",
      "downloadable": false,
      "virtual": false,
      "permalink": "https://example.com/product/premium-quality/",
      "sku": "",
      "price": "29.99",
      "regular_price": "29.99",
      "sale_price": null,
      "price_html": "<span class=\"amount\">&#36;&nbsp;29.99</span>",
      "taxable": true,
      "tax_status": "taxable",
      "tax_class": "",
      "managing_stock": false,
      "stock_quantity": 0,
      "in_stock": true,
      "backorders_allowed": false,
      "backordered": false,
      "sold_individually": false,
      "purchaseable": true,
      "featured": false,
      "visible": true,
      "catalog_visibility": "visible",
      "on_sale": false,
      "weight": null,
      "dimensions": {
        "length": "",
        "width": "",
        "height": "",
        "unit": "cm"
      },
      "shipping_required": true,
      "shipping_taxable": true,
      "shipping_class": "",
      "shipping_class_id": null,
      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
      "reviews_allowed": true,
      "average_rating": "0.00",
      "rating_count": 0,
      "related_ids": [
        37,
        47,
        31,
        19,
        22
      ],
      "upsell_ids": [],
      "cross_sell_ids": [],
      "parent_id": 0,
      "categories": [
        "Clothing",
        "T-shirts"
      ],
      "tags": [],
      "images": [
        {
          "id": 547,
          "created_at": "2015-01-22T19:46:16Z",
          "updated_at": "2015-01-22T19:46:16Z",
          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
          "title": "",
          "alt": "",
          "position": 0
        },
        {
          "id": 548,
          "created_at": "2015-01-22T19:46:17Z",
          "updated_at": "2015-01-22T19:46:17Z",
          "src": "http://example.com/wp-content/uploads/2015/01/premium-quality-back.jpg",
          "title": "",
          "alt": "",
          "position": 1
        }
      ],
      "featured_src": "http://example.com/wp-content/uploads/2015/01/premium-quality-front.jpg",
      "attributes": [],
      "downloads": [],
      "download_limit": 0,
      "download_expiry": 0,
      "download_type": "",
      "purchase_note": "",
      "total_sales": 0,
      "variations": [],
      "parent": [],
      "grouped_products": [],
      "menu_order": 0
    },
    {
      "title": "Ship Your Idea",
      "id": 604,
      "created_at": "2015-01-22T20:37:14Z",
      "updated_at": "2015-07-27T14:22:32Z",
      "type": "variable",
      "status": "publish",
      "downloadable": false,
      "virtual": false,
      "permalink": "https://example/product/ship-your-idea/",
      "sku": "",
      "price": "29.99",
      "regular_price": "0.00",
      "sale_price": null,
      "price_html": "<span class=\"amount\">&#36;&nbsp;29.99</span>",
      "taxable": true,
      "tax_status": "taxable",
      "tax_class": "",
      "managing_stock": false,
      "stock_quantity": 0,
      "in_stock": true,
      "backorders_allowed": false,
      "backordered": false,
      "sold_individually": false,
      "purchaseable": true,
      "featured": false,
      "visible": true,
      "catalog_visibility": "visible",
      "on_sale": false,
      "weight": null,
      "dimensions": {
        "length": "",
        "width": "",
        "height": "",
        "unit": "cm"
      },
      "shipping_required": true,
      "shipping_taxable": true,
      "shipping_class": "",
      "shipping_class_id": null,
      "description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.</p>\n",
      "short_description": "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.</p>\n",
      "reviews_allowed": true,
      "average_rating": "0.00",
      "rating_count": 0,
      "related_ids": [
        40,
        37,
        47,
        577,
        34
      ],
      "upsell_ids": [],
      "cross_sell_ids": [],
      "parent_id": 0,
      "categories": [
        "Clothing",
        "T-shirts"
      ],
      "tags": [],
      "images": [
        {
          "id": 605,
          "created_at": "2015-01-22T20:37:14Z",
          "updated_at": "2015-01-22T20:37:14Z",
          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
          "title": "",
          "alt": "",
          "position": 0
        },
        {
          "id": 606,
          "created_at": "2015-01-22T20:37:15Z",
          "updated_at": "2015-01-22T20:37:15Z",
          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-back.jpg",
          "title": "",
          "alt": "",
          "position": 1
        },
        {
          "id": 607,
          "created_at": "2015-01-22T20:37:15Z",
          "updated_at": "2015-01-22T20:37:15Z",
          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
          "title": "",
          "alt": "",
          "position": 2
        },
        {
          "id": 608,
          "created_at": "2015-01-22T20:37:16Z",
          "updated_at": "2015-01-22T20:37:16Z",
          "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-back.jpg",
          "title": "",
          "alt": "",
          "position": 3
        }
      ],
      "featured_src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
      "attributes": [
        {
          "name": "Color",
          "slug": "color",
          "position": 0,
          "visible": false,
          "variation": true,
          "options": [
            "Black",
            "Green"
          ]
        }
      ],
      "downloads": [],
      "download_limit": 0,
      "download_expiry": 0,
      "download_type": "",
      "purchase_note": "",
      "total_sales": 0,
      "variations": [
        {
          "id": 609,
          "created_at": "2015-01-22T20:37:14Z",
          "updated_at": "2015-07-27T14:22:32Z",
          "downloadable": false,
          "virtual": false,
          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=black",
          "sku": "",
          "price": "29.99",
          "regular_price": "29.99",
          "sale_price": null,
          "taxable": true,
          "tax_status": "taxable",
          "tax_class": "",
          "managing_stock": false,
          "stock_quantity": 0,
          "in_stock": true,
          "backordered": false,
          "purchaseable": true,
          "visible": true,
          "on_sale": false,
          "weight": null,
          "dimensions": {
            "length": "",
            "width": "",
            "height": "",
            "unit": "cm"
          },
          "shipping_class": "",
          "shipping_class_id": null,
          "image": [
            {
              "id": 610,
              "created_at": "2015-01-22T20:37:18Z",
              "updated_at": "2015-07-27T14:22:32Z",
              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-black-front.jpg",
              "title": "",
              "alt": "",
              "position": 0
            }
          ],
          "attributes": [
            {
              "name": "Color",
              "slug": "color",
              "option": "black"
            }
          ],
          "downloads": [],
          "download_limit": 0,
          "download_expiry": 0
        },
        {
          "id": 611,
          "created_at": "2015-01-22T20:37:14Z",
          "updated_at": "2015-07-27T14:22:32Z",
          "downloadable": false,
          "virtual": false,
          "permalink": "https://example/product/ship-your-idea-10/?attribute_pa_color=green",
          "sku": "",
          "price": "29.99",
          "regular_price": "29.99",
          "sale_price": null,
          "taxable": true,
          "tax_status": "taxable",
          "tax_class": "",
          "managing_stock": false,
          "stock_quantity": 0,
          "in_stock": true,
          "backordered": false,
          "purchaseable": true,
          "visible": true,
          "on_sale": false,
          "weight": null,
          "dimensions": {
            "length": "",
            "width": "",
            "height": "",
            "unit": "cm"
          },
          "shipping_class": "",
          "shipping_class_id": null,
          "image": [
            {
              "id": 612,
              "created_at": "2015-01-22T20:37:19Z",
              "updated_at": "2015-01-22T20:37:19Z",
              "src": "http://example/wp-content/uploads/2015/01/ship-your-idea-green-front.jpg",
              "title": "",
              "alt": "",
              "position": 0
            }
          ],
          "attributes": [
            {
              "name": "Color",
              "slug": "color",
              "option": "green"
            }
          ],
          "downloads": [],
          "download_limit": 0,
          "download_expiry": 0
        }
      ],
      "parent": [],
      "grouped_products": [],
      "menu_order": 0
    }
  ]
}

Delete a Product

This API helps you delete a product.

HTTP Request

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

JSON response example:

{
  "message": "Permanently deleted product"
}

Parameters

Parameter Type Description
force string Use true whether to permanently delete the product, defaults to false. Note that permanently deleting the product will return HTTP 200 rather than HTTP 202.

View Products Count

This API lets you retrieve a count of all products.

HTTP Request

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

JSON response example:

{
  "count": 2
}

Available Filters

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

This API lets you retrieve all product orders.

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

JSON response example:

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

View List of Product Reviews

This API lets you retrieve all reviews of a product.

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

JSON response example:

{
  "product_reviews": [
    {
      "id": 4,
      "created_at": "2013-06-07T11:57:45Z",
      "review": "This t-shirt is awesome! Would recommend to everyone!\n\nI'm ordering mine next week",
      "rating": "5",
      "reviewer_name": "Andrew",
      "reviewer_email": "andrew@example.com",
      "verified": false
    },
    {
      "id": 3,
      "created_at": "2013-06-07T11:53:49Z",
      "review": "Wonderful quality, and an awesome design. WooThemes ftw!",
      "rating": "4",
      "reviewer_name": "Cobus Bester",
      "reviewer_email": "cobus@example.com",
      "verified": false
    }
  ]
}

Product Reviews Properties

Attribute Type Description
id integer Review ID (comment ID) read-only
created_at string UTC DateTime when the review was created read-only
rating string Review rating (0 to 5) read-only
reviewer_name string Reviewer name read-only
reviewer_email string Reviewer email read-only
verified boolean Shows if the reviewer bought the product or not read-only

Product - Attributes

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

Product Attribute Properties

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
curl -X POST https://example.com/wc-api/v3/products/attributes \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_attribute": {
    "name": "Color",
    "slug": "pa_color",
    "type": "select",
    "order_by": "menu_order",
    "has_archives": true
  }
}'
var data = {
  product_attribute: {
    name: 'Color',
    slug: 'pa_color',
    type: 'select',
    order_by: 'menu_order',
    has_archives: true
  }
};

WooCommerce.post('products/attributes', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_attribute' => [
        'name' => 'Color',
        'slug' => 'pa_color',
        'type' => 'select',
        'order_by' => 'menu_order',
        'has_archives' => true
    ]
];

print_r($woocommerce->post('products/attributes', $data));
?>
data = {
    "product_attribute": {
        "name": "Color",
        "slug": "pa_color",
        "type": "select",
        "order_by": "menu_order",
        "has_archives": True
    }
}

print(wcapi.post("products/attributes", data).json())
data = {
  product_attribute: {
    name: "Color",
    slug: "pa_color",
    type: "select",
    order_by: "menu_order",
    has_archives: true
  }
}

woocommerce.post("products/attributes", data).parsed_response

JSON response example:

{
  "product_attribute": {
    "id": 1,
    "name": "Color",
    "slug": "pa_color",
    "type": "select",
    "order_by": "menu_order",
    "has_archives": true
  }
}

View a Product Attribute

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

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

JSON response example:

{
  "product_attribute": {
    "id": 1,
    "name": "Color",
    "slug": "pa_color",
    "type": "select",
    "order_by": "menu_order",
    "has_archives": true
  }
}

View List of Product Attributes

This API helps you to view all the product attributes.

HTTP Request

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

JSON response example:

{
  "product_attributes": [
    {
      "id": 1,
      "name": "Color",
      "slug": "pa_color",
      "type": "select",
      "order_by": "menu_order",
      "has_archives": true
    },
    {
      "id": 2,
      "name": "Size",
      "slug": "pa_size",
      "type": "select",
      "order_by": "menu_order",
      "has_archives": false
    }
  ]
}

Update a Product Attribute

This API lets you make changes to a product attribute.

HTTP Request

PUT
/wc-api/v3/products/attributes/<id>
curl -X PUT https://example.com/wc-api/v3/products/attributes/1 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_attribute": {
    "order_by": "name"
  }
}'
var data = {
  product_attribute: {
    order_by: 'name'
  }
};

WooCommerce.put('products/attributes/1', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_attribute' => [
        'order_by' => 'name'
    ]
];

print_r($woocommerce->put('products/attributes/1', $data));
?>
data = {
    "product_attribute": {
        "order_by": "name"
    }
}

print(wcapi.put("products/attributes/1", data).json())
data = {
  product_attribute: {
    order_by: "name"
  }
}

woocommerce.put("products/attributes/1", data).parsed_response

JSON response example:

{
  "product_attribute": {
    "id": 1,
    "name": "Color",
    "slug": "pa_color",
    "type": "select",
    "order_by": "name",
    "has_archives": true
  }
}

Delete a Product Attribute

This API helps you delete a product attribute.

HTTP Request

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

JSON response example:

{
  "message": "Deleted product_attribute"
}

Product - Attribute Terms

This section lists all API endpoints that can be used to create, edit or otherwise manipulate product attribute terms.

Product Attribute Properties

Attribute Type Description
id integer Term ID (term ID) read-only
name string Term name required
slug string Term slug
count integer 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
curl -X POST https://example.com/wc-api/v3/products/attributes/1/terms \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_attribute_term": {
    "name": "Black"
  }
}'
var data = {
  product_attribute_term: {
    name: 'Black'
  }
};

WooCommerce.post('products/attributes/1/terms', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_attribute_term' => [
        'name' => 'Black'
    ]
];

print_r($woocommerce->post('products/attributes/1/terms', $data));
?>
data = {
    "product_attribute_term": {
        "name": "Black"
    }
}

print(wcapi.post("products/attributes/1/terms", data).json())
data = {
  product_attribute_term: {
    name: "Black"
  }
}

woocommerce.post("products/attributes/1/terms", data).parsed_response

JSON response example:

{
  "product_attribute_term": {
    "id": 18,
    "name": "Black",
    "slug": "black",
    "count": 0
  }
}

View a Product Attribute Term

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

GET
/wc-api/v3/products/attributes/<attribute_id>/terms/<id>
curl https://example.com/wc-api/v3/products/attributes/1/terms/18 \
    -u consumer_key:consumer_secret
WooCommerce.get('products/attributes/1/terms/18', function(err, data, res) {
  console.log(res);
});
<?php print_r($woocommerce->get('products/attributes/1/terms/18')); ?>
print(wcapi.get("products/attributes/1/terms/18").json())
woocommerce.get("products/attributes/1/terms/18").parsed_response

JSON response example:

{
  "product_attribute_term": {
    "id": 18,
    "name": "Black",
    "slug": "black",
    "count": 5
  }
}

View List of Product Attribute Terms

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

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

JSON response example:

{
  "product_attribute_terms": [
    {
      "id": 18,
      "slug": "black",
      "name": "Black",
      "count": 5
    },
    {
      "id": 20,
      "slug": "blue",
      "name": "Blue",
      "count": 4
    },
    {
      "id": 19,
      "slug": "green",
      "name": "Green",
      "count": 4
    },
    {
      "id": 24,
      "slug": "pink",
      "name": "Pink",
      "count": 3
    },
    {
      "id": 22,
      "slug": "red",
      "name": "Red",
      "count": 3
    },
    {
      "id": 21,
      "slug": "white",
      "name": "White",
      "count": 3
    },
    {
      "id": 23,
      "slug": "yellow",
      "name": "Yellow",
      "count": 3
    }
  ]
}

Update a Product Attribute Term

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

HTTP Request

PUT
/wc-api/v3/products/attributes/<attribute_id>/terms/<id>
curl -X PUT https://example.com/wc-api/v3/products/attributes/1/terms/18 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_attribute_term": {
    "name": "BLACK"
  }
}'
var data = {
  product_attribute_term: {
    name: 'BLACK'
  }
};

WooCommerce.put('products/attributes/1/terms/18', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_attribute_term' => [
        'name' => 'BLACK'
    ]
];

print_r($woocommerce->put('products/attributes/1/terms/18', $data));
?>
data = {
    "product_attribute_term": {
        "name": "BLACK"
    }
}

print(wcapi.put("products/attributes/1/terms/18", data).json())
data = {
  product_attribute_term: {
    name: "BLACK"
  }
}

woocommerce.put("products/attributes/1/terms/18", data).parsed_response

JSON response example:

{
  "product_attribute_term": {
    "id": 18,
    "name": "BLACK",
    "slug": "black",
    "count": 5
  }
}

Delete a Product Attribute Term

This API helps you delete a product attribute term.

HTTP Request

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

JSON response example:

{
  "message": "Deleted product_attribute_term"
}

Product - Categories

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

Product Category Properties

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 integer 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:

curl -X POST https://example.com/wc-api/v3/products/categories \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_category": {
    "name": "Clothing"
  }
}'
var data = {
  product_category: {
    name: 'Clothing'
  }
};

WooCommerce.post('products/categories', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_category' => [
        'name' => 'Clothing'
    ]
];

print_r($woocommerce->post('products/categories', $data));
?>
data = {
    "product_category": {
        "name": "Clothing"
    }
}

print(wcapi.post("products/categories", data).json())
data = {
  product_category: {
    name: "Clothing"
  }
}

woocommerce.post("products/categories", data).parsed_response

JSON response example:

{
  "product_category": {
    "id": 9,
    "name": "Clothing",
    "slug": "clothing",
    "parent": 0,
    "description": "",
    "display": "default",
    "image": "",
    "count": 0
  }
}

View a Product Category

This API lets you retrieve a product category by ID.

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

JSON response example:

{
  "product_category": {
    "id": 9,
    "name": "Clothing",
    "slug": "clothing",
    "parent": 0,
    "description": "",
    "display": "default",
    "image": "",
    "count": 23
  }
}

View List of Product Categories

This API lets you retrieve all product categories.

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

JSON response example:

{
  "product_categories": [
    {
      "id": 15,
      "name": "Albums",
      "slug": "albums",
      "parent": 11,
      "description": "",
      "display": "default",
      "image": "",
      "count": 4
    },
    {
      "id": 9,
      "name": "Clothing",
      "slug": "clothing",
      "parent": 0,
      "description": "",
      "display": "default",
      "image": "",
      "count": 23
    },
    {
      "id": 10,
      "name": "Hoodies",
      "slug": "hoodies",
      "parent": 9,
      "description": "",
      "display": "default",
      "image": "",
      "count": 6
    },
    {
      "id": 11,
      "name": "Music",
      "slug": "music",
      "parent": 0,
      "description": "",
      "display": "default",
      "image": "",
      "count": 6
    },
    {
      "id": 12,
      "name": "Posters",
      "slug": "posters",
      "parent": 0,
      "description": "",
      "display": "default",
      "image": "",
      "count": 5
    },
    {
      "id": 13,
      "name": "Singles",
      "slug": "singles",
      "parent": 11,
      "description": "",
      "display": "default",
      "image": "",
      "count": 2
    },
    {
      "id": 14,
      "name": "T-shirts",
      "slug": "t-shirts",
      "parent": 9,
      "description": "",
      "display": "default",
      "image": "",
      "count": 17
    }
  ]
}

Update a Product Category

This API lets you make changes to a product category.

HTTP Request

PUT
/wc-api/v3/products/categories/<id>
curl -X PUT https://example.com/wc-api/v3/products/categories/9 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_category": {
    "description": "All kinds of clothes."
  }
}'
var data = {
  product_category: {
    description: 'All kinds of clothes.'
  }
};

WooCommerce.put('products/categories/9', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_category' => [
        'description' => 'All kinds of clothes.'
    ]
];

print_r($woocommerce->put('products/categories/9', $data));
?>
data = {
    "product_category": {
        "description": "All kinds of clothes."
    }
}

print(wcapi.put("products/categories/9", data).json())
data = {
  product_category: {
    description: "All kinds of clothes."
  }
}

woocommerce.put("products/categories/9", data).parsed_response

JSON response example:

{
  "product_category": {
    "id": 9,
    "name": "Clothing",
    "slug": "clothing",
    "parent": 0,
    "description": "All kinds of clothes.",
    "display": "default",
    "image": "",
    "count": 23
  }
}

Delete a Product Category

This API helps you delete a product category.

HTTP Request

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

JSON response example:

{
  "message": "Deleted product_category"
}

Product - Shipping Classes

This section lists all API endpoints that can be used to create, edit or otherwise manipulate product shipping classes.

Product Shipping Class Properties

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 integer 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:

curl -X POST https://example.com/wc-api/v3/products/shipping_classes \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_shipping_class": {
    "name": "Priority"
  }
}'
var data = {
  product_shipping_class: {
    name: 'Priority'
  }
};

WooCommerce.post('products/shipping_classes', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_shipping_class' => [
        'name' => 'Priority'
    ]
];

print_r($woocommerce->post('products/shipping_classes', $data));
?>
data = {
    "product_shipping_class": {
        "name": "Priority"
    }
}

print(wcapi.post("products/shipping_classes", data).json())
data = {
  product_shipping_class: {
    name: "Priority"
  }
}

woocommerce.post("products/shipping_classes", data).parsed_response

JSON response example:

{
  "product_shipping_class": {
    "id": 35,
    "name": "Priority",
    "slug": "priority",
    "parent": 0,
    "description": "",
    "count": 0
  }
}

View a Product Shipping Class

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

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

JSON response example:

{
  "product_shipping_class": {
    "id": 35,
    "name": "Priority",
    "slug": "priority",
    "parent": 0,
    "description": "",
    "count": 0
  }
}

View List of Product Shipping Classes

This API lets you retrieve all product shipping classes.

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

JSON response example:

{
  "product_shipping_classes": [
    {
      "id": 30,
      "name": "Express",
      "slug": "express",
      "parent": 0,
      "description": "",
      "count": 1
    },
    {
      "id": 35,
      "name": "Priority",
      "slug": "priority",
      "parent": 0,
      "description": "",
      "count": 0
    }
  ]
}

Update a Product Shipping Class

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

HTTP Request

PUT
/wc-api/v3/products/shipping_classes/<id>
curl -X PUT https://example.com/wc-api/v3/products/shipping_classes/35 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_shipping_class": {
    "description": "Priority mail."
  }
}'
var data = {
  product_shipping_class: {
    description: 'Priority mail.'
  }
};

WooCommerce.put('products/shipping_classes/35', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_shipping_class' => [
        'description' => 'Priority mail.'
    ]
];

print_r($woocommerce->put('products/shipping_classes/35', $data));
?>
data = {
    "product_shipping_class": {
        "description": "Priority mail."
    }
}

print(wcapi.put("products/shipping_classes/35", data).json())
data = {
  product_shipping_class: {
    description: "Priority mail."
  }
}

woocommerce.put("products/shipping_classes/35", data).parsed_response

JSON response example:

{
  "product_shipping_class": {
    "id": 35,
    "name": "Priority",
    "slug": "priority",
    "parent": 0,
    "description": "Priority mail.",
    "count": 0
  }
}

Delete a Product Shipping Class

This API helps you delete a product shipping class.

HTTP Request

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

JSON response example:

{
  "message": "Deleted product_shipping_class"
}

Product - Tags

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

Product Tag Properties

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 integer 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:

curl -X POST https://example.com/wc-api/v3/products/tags \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_tag": {
    "name": "Leather Shoes"
  }
}'
var data = {
  product_tag: {
    name: 'Leather Shoes'
  }
};

WooCommerce.post('products/tags', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_tag': [
        'name' => 'Leather Shoes'
    ]
];

print_r($woocommerce->post('products/tags', $data));
?>
data = {
    "product_tag": {
        "name": "Leather Shoes"
    }
}

print(wcapi.post("products/tags", data).json())
data = {
  product_tag: {
    name: "Leather Shoes"
  }
}

woocommerce.post("products/tags", data).parsed_response

JSON response example:

{
  "product_tag": {
    "id": 37,
    "name": "Leather Shoes",
    "slug": "leather-shoes",
    "description": "",
    "count": 0
  }
}

View a Product Tag

This API lets you retrieve a product tag by ID.

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

JSON response example:

{
  "product_tag": {
    "id": 37,
    "name": "Leather Shoes",
    "slug": "leather-shoes",
    "description": "",
    "count": 0
  }
}

View List of Product Tags

This API lets you retrieve all product tag.

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

JSON response example:

{
  "product_tags": [
    {
      "id": 37,
      "name": "Leather Shoes",
      "slug": "leather-shoes",
      "description": "",
      "count": 0
    },
    {
      "id": 38,
      "name": "Oxford Shoes",
      "slug": "oxford-shoes",
      "description": "",
      "count": 0
    }
  ]
}

Update a Product Tag

This API lets you make changes to a product tag.

HTTP Request

PUT
/wc-api/v3/products/tags/<id>
curl -X PUT https://example.com/wc-api/v3/products/tags/37 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "product_tag": {
    "description": "Genuine leather."
  }
}'
var data = {
  product_tag: {
    description: 'Genuine leather.'
  }
};

WooCommerce.put('products/tags/37', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'product_tag': [
        'description': 'Genuine leather.'
    ]
];

print_r($woocommerce->put('products/tags/37', $data));
?>
data = {
    "product_tag": {
        "description": "Genuine leather."
    }
}

print(wcapi.put("products/tags/37", data).json())
data = {
  product_tag: {
    description: "Genuine leather."
  }
}

woocommerce.put("products/tags/37", data).parsed_response

JSON response example:

{
  "product_tag": {
    "id": 37,
    "name": "Leather Shoes",
    "slug": "leather-shoes",
    "description": "Genuine leather.",
    "count": 0
  }
}

Delete a Product Tag

This API helps you delete a product tag.

HTTP Request

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

JSON response example:

{
  "message": "Deleted product_tag"
}

Reports

This section lists all API endpoints that can be used view reports.

Reports Filters

Use the following filters for any type of report to specify the period of sales:

Filter Type Description
period string The supported periods are: week, month, last_month, and year. If you use an invalid period, week is used. If you don't specify a period, the current day is used
date_min string Return sales for a specific start date. The date need to be in the YYYY-MM-DD format
date_max string Return sales for a specific end date. The dates need to be in the YYYY-MM-DD format. Required to set the filter[date_min] too

View List of Reports

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

HTTP Request

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

JSON response example:

{
  "reports": [
    "sales",
    "sales/top_sellers"
  ]
}

View List of Sales Report

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

HTTP Request

GET
/wc-api/v3/reports/sales
curl https://example.com/wc-api/v3/reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21 \
    -u consumer_key:consumer_secret
WooCommerce.get('reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21', function(err, data, res) {
  console.log(res);
});
<?php
$query = [
    'filter' => [
        'date_min' => '2015-01-18', 
        'date_max' => '2015-01-21'
    ]
];

print_r($woocommerce->get('reports/sales', $query));
?>
print(wcapi.get("reports/sales?filter[date_min]=2015-01-18&filter[date_max]=2015-01-21").json())
query = {
  filter: {
    date_min: "2015-01-18",
    date_max: "2015-01-21"
  }
}

woocommerce.get("reports/sales", query).parsed_response

JSON response example:

{
  "sales": {
    "total_sales": "580.10",
    "average_sales": "145.03",
    "total_orders": 4,
    "total_items": 31,
    "total_tax": "26.10",
    "total_shipping": "20.00",
    "total_discount": "0.00",
    "totals_grouped_by": "day",
    "totals": {
      "2015-01-18": {
        "sales": "-17.00",
        "orders": 1,
        "items": 1,
        "tax": "0.00",
        "shipping": "0.00",
        "discount": "0.00",
        "customers": 0
      },
      "2015-01-19": {
        "sales": "0.00",
        "orders": 0,
        "items": 0,
        "tax": "0.00",
        "shipping": "0.00",
        "discount": "0.00",
        "customers": 0
      },
      "2015-01-20": {
        "sales": "0.00",
        "orders": 0,
        "items": 0,
        "tax": "0.00",
        "shipping": "0.00",
        "discount": "0.00",
        "customers": 0
      },
      "2015-01-21": {
        "sales": "597.10",
        "orders": 3,
        "items": 30,
        "tax": "26.10",
        "shipping": "20.00",
        "discount": "0.00",
        "customers": 0
      }
    },
    "total_customers": 0
  }
}

View List of Top Sellers Report

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

HTTP Request

GET
/wc-api/v3/reports/sales/top_sellers
curl https://example.com/wc-api/v3/reports/sales/top_sellers?filter[period]=last_month \
    -u consumer_key:consumer_secret
WooCommerce.get('reports/sales/top_sellers?filter[period]=last_month', function(err, data, res) {
  console.log(res);
});
<?php
$query = [
    'filter' => [
        'period' => 'last_month'
    ]
];

print_r($woocommerce->get('reports/sales/top_sellers', $query));
?>
print(wcapi.get("reports/sales/top_sellers?filter[period]=last_month").json())
query = {
  filter: {
    period: "last_month"
  }
}

woocommerce.get("reports/sales/top_sellers", query).parsed_response

JSON response example:

{
  "top_sellers": [
    {
      "title": "Happy Ninja",
      "product_id": "37",
      "quantity": "24"
    },
    {
      "title": "Flying Ninja",
      "product_id": "70",
      "quantity": "14"
    },
    {
      "title": "Happy Ninja",
      "product_id": "53",
      "quantity": "6"
    },
    {
      "title": "Ninja Silhouette",
      "product_id": "31",
      "quantity": "3"
    },
    {
      "title": "Woo Logo",
      "product_id": "15",
      "quantity": "3"
    },
    {
      "title": "Woo Album #1",
      "product_id": "83",
      "quantity": "3"
    },
    {
      "title": "Woo Album #4",
      "product_id": "96",
      "quantity": "1"
    },
    {
      "title": "Premium Quality",
      "product_id": "19",
      "quantity": "1"
    },
    {
      "title": "Ninja Silhouette",
      "product_id": "56",
      "quantity": "1"
    }
  ]
}

Taxes

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

Taxes Properties

Attribute Type Description
id integer Tax rate ID read-only
country string Country code. See ISO 3166 Codes (Countries) for more details
state string State code
postcode string Postcode/ZIP
city string City name
rate string Tax rate
name string Tax rate name
priority integer Tax priority. Only 1 matching rate per priority will be used. To define multiple tax rates for a single area you need to specify a different priority per rate. Default is 1
compound boolean 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
curl -X POST https://example.com/wc-api/v3/taxes \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "tax": {
    "country": "US",
    "state": "AL",
    "rate": "4",
    "name": "State Tax",
    "shipping": false
  }
}'
var data = {
  tax: {
    country: 'US',
    state: 'AL',
    rate: '4',
    name: 'State Tax',
    shipping: false
  }
};

WooCommerce.post('taxes', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'tax' => [
        'country' => 'US',
        'state' => 'AL',
        'rate' => '4',
        'name' => 'State Tax',
        'shipping' => false
    ]
];

print_r($woocommerce->post('taxes', $data));
?>
data = {
    "tax": {
        "country": "US",
        "state": "AL",
        "rate": "4",
        "name": "State Tax",
        "shipping": False
    }
}

print(wcapi.post("taxes", data).json())
data = {
  tax: {
    country: "US",
    state: "AL",
    rate: "4",
    name: "State Tax",
    shipping: false
  }
}

woocommerce.post("taxes", data).parsed_response

JSON response example:

{
  "tax": {
    "id": 53,
    "country": "US",
    "state": "AL",
    "postcode": "",
    "city": "",
    "rate": "4.0000",
    "name": "State Tax",
    "priority": 1,
    "compound": false,
    "shipping": false,
    "order": 0,
    "class": "standard"
  }
}

View a Tax Rate

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

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

JSON response example:

{
  "tax": {
    "id": 53,
    "country": "US",
    "state": "AL",
    "postcode": "",
    "city": "",
    "rate": "4.0000",
    "name": "State Tax",
    "priority": 1,
    "compound": false,
    "shipping": false,
    "order": 0,
    "class": "standard"
  }
}

View List of Tax Rates

This API helps you to view all the tax rates.

HTTP Request

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

JSON response example:

{
  "taxes": [
    {
      "id": 53,
      "country": "US",
      "state": "AL",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 1,
      "class": "standard"
    },
    {
      "id": 54,
      "country": "US",
      "state": "AZ",
      "postcode": "",
      "city": "",
      "rate": "5.6000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 2,
      "class": "standard"
    },
    {
      "id": 55,
      "country": "US",
      "state": "AR",
      "postcode": "",
      "city": "",
      "rate": "6.5000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 3,
      "class": "standard"
    },
    {
      "id": 56,
      "country": "US",
      "state": "CA",
      "postcode": "",
      "city": "",
      "rate": "7.5000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 4,
      "class": "standard"
    },
    {
      "id": 57,
      "country": "US",
      "state": "CO",
      "postcode": "",
      "city": "",
      "rate": "2.9000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 5,
      "class": "standard"
    },
    {
      "id": 58,
      "country": "US",
      "state": "CT",
      "postcode": "",
      "city": "",
      "rate": "6.3500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 6,
      "class": "standard"
    },
    {
      "id": 59,
      "country": "US",
      "state": "DC",
      "postcode": "",
      "city": "",
      "rate": "5.7500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 7,
      "class": "standard"
    },
    {
      "id": 60,
      "country": "US",
      "state": "FL",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 8,
      "class": "standard"
    },
    {
      "id": 61,
      "country": "US",
      "state": "GA",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 9,
      "class": "standard"
    },
    {
      "id": 62,
      "country": "US",
      "state": "GU",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 10,
      "class": "standard"
    },
    {
      "id": 63,
      "country": "US",
      "state": "HI",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 11,
      "class": "standard"
    },
    {
      "id": 64,
      "country": "US",
      "state": "ID",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 12,
      "class": "standard"
    }
  ]
}

Available Filters

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>
curl -X PUT https://example.com/wc-api/v3/taxes/53 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "tax": {
    "name": "US Tax"
  }
}'
var data = {
  tax: {
    name: 'US Tax'
  }
};

WooCommerce.put('taxes/53', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'tax' => [
        'name' => 'US Tax'
    ]
];

print_r($woocommerce->put('taxes/53', $data));
?>
data = {
    "tax": {
        "name": "US Tax"
    }
}

print(wcapi.put("taxes/53", data).json())
data = {
  tax: {
    name: "US Tax"
  }
}

woocommerce.put("taxes/53", data).parsed_response

JSON response example:

{
  "tax": {
    "id": 53,
    "country": "US",
    "state": "AL",
    "postcode": "",
    "city": "",
    "rate": "4.0000",
    "name": "US Tax",
    "priority": 1,
    "compound": false,
    "shipping": false,
    "order": 0,
    "class": "standard"
  }
}

Create/Update Multiple Tax Rates

This API helps you to bulk create/update multiple tax rates.

To update is necessary to send objects containing IDs and to create new not just send the ID.

HTTP Request

POST
/wc-api/v3/taxes/bulk

Example bulk creating all US taxes:

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

WooCommerce.post('taxes/bulk', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'taxes' => [
        [
            'country' => 'US',
            'state' => 'AL',
            'rate' => '4.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 1
        ],
        [
            'country' => 'US',
            'state' => 'AZ',
            'rate' => '5.6000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 2
        ],
        [
            'country' => 'US',
            'state' => 'AR',
            'rate' => '6.5000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 3
        ],
        [
            'country' => 'US',
            'state' => 'CA',
            'rate' => '7.5000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 4
        ],
        [
            'country' => 'US',
            'state' => 'CO',
            'rate' => '2.9000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 5
        ],
        [
            'country' => 'US',
            'state' => 'CT',
            'rate' => '6.3500',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 6
        ],
        [
            'country' => 'US',
            'state' => 'DC',
            'rate' => '5.7500',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 7
        ],
        [
            'country' => 'US',
            'state' => 'FL',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 8
        ],
        [
            'country' => 'US',
            'state' => 'GA',
            'rate' => '4.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 9
        ],
        [
            'country' => 'US',
            'state' => 'GU',
            'rate' => '4.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 10
        ],
        [
            'country' => 'US',
            'state' => 'HI',
            'rate' => '4.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 11
        ],
        [
            'country' => 'US',
            'state' => 'ID',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 12
        ],
        [
            'country' => 'US',
            'state' => 'IL',
            'rate' => '6.2500',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 13
        ],
        [
            'country' => 'US',
            'state' => 'IN',
            'rate' => '7.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 14
        ],
        [
            'country' => 'US',
            'state' => 'IA',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 15
        ],
        [
            'country' => 'US',
            'state' => 'KS',
            'rate' => '6.1500',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 16
        ],
        [
            'country' => 'US',
            'state' => 'KY',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 17
        ],
        [
            'country' => 'US',
            'state' => 'LA',
            'rate' => '4.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 18
        ],
        [
            'country' => 'US',
            'state' => 'ME',
            'rate' => '5.5000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 19
        ],
        [
            'country' => 'US',
            'state' => 'MD',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 20
        ],
        [
            'country' => 'US',
            'state' => 'MA',
            'rate' => '6.2500',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 21
        ],
        [
            'country' => 'US',
            'state' => 'MI',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 22
        ],
        [
            'country' => 'US',
            'state' => 'MN',
            'rate' => '6.8750',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 23
        ],
        [
            'country' => 'US',
            'state' => 'MS',
            'rate' => '7.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 24
        ],
        [
            'country' => 'US',
            'state' => 'MO',
            'rate' => '4.2250',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 25
        ],
        [
            'country' => 'US',
            'state' => 'NE',
            'rate' => '5.5000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 26
        ],
        [
            'country' => 'US',
            'state' => 'NV',
            'rate' => '6.8500',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 27
        ],
        [
            'country' => 'US',
            'state' => 'NJ',
            'rate' => '7.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 28
        ],
        [
            'country' => 'US',
            'state' => 'NM',
            'rate' => '5.1250',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 29
        ],
        [
            'country' => 'US',
            'state' => 'NY',
            'rate' => '4.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 30
        ],
        [
            'country' => 'US',
            'state' => 'NC',
            'rate' => '4.7500',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 31
        ],
        [
            'country' => 'US',
            'state' => 'ND',
            'rate' => '5.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 32
        ],
        [
            'country' => 'US',
            'state' => 'OH',
            'rate' => '5.7500',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 33
        ],
        [
            'country' => 'US',
            'state' => 'OK',
            'rate' => '4.5000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 34
        ],
        [
            'country' => 'US',
            'state' => 'PA',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 35
        ],
        [
            'country' => 'US',
            'state' => 'PR',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 36
        ],
        [
            'country' => 'US',
            'state' => 'RI',
            'rate' => '7.0000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 37
        ],
        [
            'country' => 'US',
            'state' => 'SC',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 38
        ],
        [
            'country' => 'US',
            'state' => 'SD',
            'rate' => '4.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 39
        ],
        [
            'country' => 'US',
            'state' => 'TN',
            'rate' => '7.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 40
        ],
        [
            'country' => 'US',
            'state' => 'TX',
            'rate' => '6.2500',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 41
        ],
        [
            'country' => 'US',
            'state' => 'UT',
            'rate' => '5.9500',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 42
        ],
        [
            'country' => 'US',
            'state' => 'VT',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 43
        ],
        [
            'country' => 'US',
            'state' => 'VA',
            'rate' => '5.3000',
            'name' => 'State Tax',
            'shipping' => false,
            'order' => 44
        ],
        [
            'country' => 'US',
            'state' => 'WA',
            'rate' => '6.5000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 45
        ],
        [
            'country' => 'US',
            'state' => 'WV',
            'rate' => '6.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 46
        ],
        [
            'country' => 'US',
            'state' => 'WI',
            'rate' => '5.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 47
        ],
        [
            'country' => 'US',
            'state' => 'WY',
            'rate' => '4.0000',
            'name' => 'State Tax',
            'shipping' => true,
            'order' => 48
        ]
    ]
];

print_r($woocommerce->post('taxes/bulk', $data));
?>
data = {
    "taxes": [
        {
            "country": "US",
            "state": "AL",
            "rate": "4.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 1
        },
        {
            "country": "US",
            "state": "AZ",
            "rate": "5.6000",
            "name": "State Tax",
            "shipping": False,
            "order": 2
        },
        {
            "country": "US",
            "state": "AR",
            "rate": "6.5000",
            "name": "State Tax",
            "shipping": True,
            "order": 3
        },
        {
            "country": "US",
            "state": "CA",
            "rate": "7.5000",
            "name": "State Tax",
            "shipping": False,
            "order": 4
        },
        {
            "country": "US",
            "state": "CO",
            "rate": "2.9000",
            "name": "State Tax",
            "shipping": False,
            "order": 5
        },
        {
            "country": "US",
            "state": "CT",
            "rate": "6.3500",
            "name": "State Tax",
            "shipping": True,
            "order": 6
        },
        {
            "country": "US",
            "state": "DC",
            "rate": "5.7500",
            "name": "State Tax",
            "shipping": True,
            "order": 7
        },
        {
            "country": "US",
            "state": "FL",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 8
        },
        {
            "country": "US",
            "state": "GA",
            "rate": "4.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 9
        },
        {
            "country": "US",
            "state": "GU",
            "rate": "4.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 10
        },
        {
            "country": "US",
            "state": "HI",
            "rate": "4.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 11
        },
        {
            "country": "US",
            "state": "ID",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 12
        },
        {
            "country": "US",
            "state": "IL",
            "rate": "6.2500",
            "name": "State Tax",
            "shipping": False,
            "order": 13
        },
        {
            "country": "US",
            "state": "IN",
            "rate": "7.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 14
        },
        {
            "country": "US",
            "state": "IA",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 15
        },
        {
            "country": "US",
            "state": "KS",
            "rate": "6.1500",
            "name": "State Tax",
            "shipping": True,
            "order": 16
        },
        {
            "country": "US",
            "state": "KY",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 17
        },
        {
            "country": "US",
            "state": "LA",
            "rate": "4.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 18
        },
        {
            "country": "US",
            "state": "ME",
            "rate": "5.5000",
            "name": "State Tax",
            "shipping": False,
            "order": 19
        },
        {
            "country": "US",
            "state": "MD",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 20
        },
        {
            "country": "US",
            "state": "MA",
            "rate": "6.2500",
            "name": "State Tax",
            "shipping": False,
            "order": 21
        },
        {
            "country": "US",
            "state": "MI",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 22
        },
        {
            "country": "US",
            "state": "MN",
            "rate": "6.8750",
            "name": "State Tax",
            "shipping": True,
            "order": 23
        },
        {
            "country": "US",
            "state": "MS",
            "rate": "7.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 24
        },
        {
            "country": "US",
            "state": "MO",
            "rate": "4.2250",
            "name": "State Tax",
            "shipping": False,
            "order": 25
        },
        {
            "country": "US",
            "state": "NE",
            "rate": "5.5000",
            "name": "State Tax",
            "shipping": True,
            "order": 26
        },
        {
            "country": "US",
            "state": "NV",
            "rate": "6.8500",
            "name": "State Tax",
            "shipping": False,
            "order": 27
        },
        {
            "country": "US",
            "state": "NJ",
            "rate": "7.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 28
        },
        {
            "country": "US",
            "state": "NM",
            "rate": "5.1250",
            "name": "State Tax",
            "shipping": True,
            "order": 29
        },
        {
            "country": "US",
            "state": "NY",
            "rate": "4.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 30
        },
        {
            "country": "US",
            "state": "NC",
            "rate": "4.7500",
            "name": "State Tax",
            "shipping": True,
            "order": 31
        },
        {
            "country": "US",
            "state": "ND",
            "rate": "5.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 32
        },
        {
            "country": "US",
            "state": "OH",
            "rate": "5.7500",
            "name": "State Tax",
            "shipping": True,
            "order": 33
        },
        {
            "country": "US",
            "state": "OK",
            "rate": "4.5000",
            "name": "State Tax",
            "shipping": False,
            "order": 34
        },
        {
            "country": "US",
            "state": "PA",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 35
        },
        {
            "country": "US",
            "state": "PR",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 36
        },
        {
            "country": "US",
            "state": "RI",
            "rate": "7.0000",
            "name": "State Tax",
            "shipping": False,
            "order": 37
        },
        {
            "country": "US",
            "state": "SC",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 38
        },
        {
            "country": "US",
            "state": "SD",
            "rate": "4.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 39
        },
        {
            "country": "US",
            "state": "TN",
            "rate": "7.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 40
        },
        {
            "country": "US",
            "state": "TX",
            "rate": "6.2500",
            "name": "State Tax",
            "shipping": True,
            "order": 41
        },
        {
            "country": "US",
            "state": "UT",
            "rate": "5.9500",
            "name": "State Tax",
            "shipping": False,
            "order": 42
        },
        {
            "country": "US",
            "state": "VT",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 43
        },
        {
            "country": "US",
            "state": "VA",
            "rate": "5.3000",
            "name": "State Tax",
            "shipping": False,
            "order": 44
        },
        {
            "country": "US",
            "state": "WA",
            "rate": "6.5000",
            "name": "State Tax",
            "shipping": True,
            "order": 45
        },
        {
            "country": "US",
            "state": "WV",
            "rate": "6.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 46
        },
        {
            "country": "US",
            "state": "WI",
            "rate": "5.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 47
        },
        {
            "country": "US",
            "state": "WY",
            "rate": "4.0000",
            "name": "State Tax",
            "shipping": True,
            "order": 48
        }
    ]
}

print(wcapi.post("taxes/bulk", data).json())
data = {
  taxes: [
    {
      country: "US",
      state: "AL",
      rate: "4.0000",
      name: "State Tax",
      shipping: false,
      order: 1
    },
    {
      country: "US",
      state: "AZ",
      rate: "5.6000",
      name: "State Tax",
      shipping: false,
      order: 2
    },
    {
      country: "US",
      state: "AR",
      rate: "6.5000",
      name: "State Tax",
      shipping: true,
      order: 3
    },
    {
      country: "US",
      state: "CA",
      rate: "7.5000",
      name: "State Tax",
      shipping: false,
      order: 4
    },
    {
      country: "US",
      state: "CO",
      rate: "2.9000",
      name: "State Tax",
      shipping: false,
      order: 5
    },
    {
      country: "US",
      state: "CT",
      rate: "6.3500",
      name: "State Tax",
      shipping: true,
      order: 6
    },
    {
      country: "US",
      state: "DC",
      rate: "5.7500",
      name: "State Tax",
      shipping: true,
      order: 7
    },
    {
      country: "US",
      state: "FL",
      rate: "6.0000",
      name: "State Tax",
      shipping: true,
      order: 8
    },
    {
      country: "US",
      state: "GA",
      rate: "4.0000",
      name: "State Tax",
      shipping: true,
      order: 9
    },
    {
      country: "US",
      state: "GU",
      rate: "4.0000",
      name: "State Tax",
      shipping: false,
      order: 10
    },
    {
      country: "US",
      state: "HI",
      rate: "4.0000",
      name: "State Tax",
      shipping: true,
      order: 11
    },
    {
      country: "US",
      state: "ID",
      rate: "6.0000",
      name: "State Tax",
      shipping: false,
      order: 12
    },
    {
      country: "US",
      state: "IL",
      rate: "6.2500",
      name: "State Tax",
      shipping: false,
      order: 13
    },
    {
      country: "US",
      state: "IN",
      rate: "7.0000",
      name: "State Tax",
      shipping: false,
      order: 14
    },
    {
      country: "US",
      state: "IA",
      rate: "6.0000",
      name: "State Tax",
      shipping: false,
      order: 15
    },
    {
      country: "US",
      state: "KS",
      rate: "6.1500",
      name: "State Tax",
      shipping: true,
      order: 16
    },
    {
      country: "US",
      state: "KY",
      rate: "6.0000",
      name: "State Tax",
      shipping: true,
      order: 17
    },
    {
      country: "US",
      state: "LA",
      rate: "4.0000",
      name: "State Tax",
      shipping: false,
      order: 18
    },
    {
      country: "US",
      state: "ME",
      rate: "5.5000",
      name: "State Tax",
      shipping: false,
      order: 19
    },
    {
      country: "US",
      state: "MD",
      rate: "6.0000",
      name: "State Tax",
      shipping: false,
      order: 20
    },
    {
      country: "US",
      state: "MA",
      rate: "6.2500",
      name: "State Tax",
      shipping: false,
      order: 21
    },
    {
      country: "US",
      state: "MI",
      rate: "6.0000",
      name: "State Tax",
      shipping: true,
      order: 22
    },
    {
      country: "US",
      state: "MN",
      rate: "6.8750",
      name: "State Tax",
      shipping: true,
      order: 23
    },
    {
      country: "US",
      state: "MS",
      rate: "7.0000",
      name: "State Tax",
      shipping: true,
      order: 24
    },
    {
      country: "US",
      state: "MO",
      rate: "4.2250",
      name: "State Tax",
      shipping: false,
      order: 25
    },
    {
      country: "US",
      state: "NE",
      rate: "5.5000",
      name: "State Tax",
      shipping: true,
      order: 26
    },
    {
      country: "US",
      state: "NV",
      rate: "6.8500",
      name: "State Tax",
      shipping: false,
      order: 27
    },
    {
      country: "US",
      state: "NJ",
      rate: "7.0000",
      name: "State Tax",
      shipping: true,
      order: 28
    },
    {
      country: "US",
      state: "NM",
      rate: "5.1250",
      name: "State Tax",
      shipping: true,
      order: 29
    },
    {
      country: "US",
      state: "NY",
      rate: "4.0000",
      name: "State Tax",
      shipping: true,
      order: 30
    },
    {
      country: "US",
      state: "NC",
      rate: "4.7500",
      name: "State Tax",
      shipping: true,
      order: 31
    },
    {
      country: "US",
      state: "ND",
      rate: "5.0000",
      name: "State Tax",
      shipping: true,
      order: 32
    },
    {
      country: "US",
      state: "OH",
      rate: "5.7500",
      name: "State Tax",
      shipping: true,
      order: 33
    },
    {
      country: "US",
      state: "OK",
      rate: "4.5000",
      name: "State Tax",
      shipping: false,
      order: 34
    },
    {
      country: "US",
      state: "PA",
      rate: "6.0000",
      name: "State Tax",
      shipping: true,
      order: 35
    },
    {
      country: "US",
      state: "PR",
      rate: "6.0000",
      name: "State Tax",
      shipping: false,
      order: 36
    },
    {
      country: "US",
      state: "RI",
      rate: "7.0000",
      name: "State Tax",
      shipping: false,
      order: 37
    },
    {
      country: "US",
      state: "SC",
      rate: "6.0000",
      name: "State Tax",
      shipping: true,
      order: 38
    },
    {
      country: "US",
      state: "SD",
      rate: "4.0000",
      name: "State Tax",
      shipping: true,
      order: 39
    },
    {
      country: "US",
      state: "TN",
      rate: "7.0000",
      name: "State Tax",
      shipping: true,
      order: 40
    },
    {
      country: "US",
      state: "TX",
      rate: "6.2500",
      name: "State Tax",
      shipping: true,
      order: 41
    },
    {
      country: "US",
      state: "UT",
      rate: "5.9500",
      name: "State Tax",
      shipping: false,
      order: 42
    },
    {
      country: "US",
      state: "VT",
      rate: "6.0000",
      name: "State Tax",
      shipping: true,
      order: 43
    },
    {
      country: "US",
      state: "VA",
      rate: "5.3000",
      name: "State Tax",
      shipping: false,
      order: 44
    },
    {
      country: "US",
      state: "WA",
      rate: "6.5000",
      name: "State Tax",
      shipping: true,
      order: 45
    },
    {
      country: "US",
      state: "WV",
      rate: "6.0000",
      name: "State Tax",
      shipping: true,
      order: 46
    },
    {
      country: "US",
      state: "WI",
      rate: "5.0000",
      name: "State Tax",
      shipping: true,
      order: 47
    },
    {
      country: "US",
      state: "WY",
      rate: "4.0000",
      name: "State Tax",
      shipping: true,
      order: 48
    }
  ]
}

woocommerce.post("taxes/bulk", data).parsed_response

JSON response example:

{
  "taxes": [
    {
      "id": 53,
      "country": "US",
      "state": "AL",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 1,
      "class": "standard"
    },
    {
      "id": 54,
      "country": "US",
      "state": "AZ",
      "postcode": "",
      "city": "",
      "rate": "5.6000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 2,
      "class": "standard"
    },
    {
      "id": 55,
      "country": "US",
      "state": "AR",
      "postcode": "",
      "city": "",
      "rate": "6.5000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 3,
      "class": "standard"
    },
    {
      "id": 56,
      "country": "US",
      "state": "CA",
      "postcode": "",
      "city": "",
      "rate": "7.5000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 4,
      "class": "standard"
    },
    {
      "id": 57,
      "country": "US",
      "state": "CO",
      "postcode": "",
      "city": "",
      "rate": "2.9000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 5,
      "class": "standard"
    },
    {
      "id": 58,
      "country": "US",
      "state": "CT",
      "postcode": "",
      "city": "",
      "rate": "6.3500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 6,
      "class": "standard"
    },
    {
      "id": 59,
      "country": "US",
      "state": "DC",
      "postcode": "",
      "city": "",
      "rate": "5.7500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 7,
      "class": "standard"
    },
    {
      "id": 60,
      "country": "US",
      "state": "FL",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 8,
      "class": "standard"
    },
    {
      "id": 61,
      "country": "US",
      "state": "GA",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 9,
      "class": "standard"
    },
    {
      "id": 62,
      "country": "US",
      "state": "GU",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 10,
      "class": "standard"
    },
    {
      "id": 63,
      "country": "US",
      "state": "HI",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 11,
      "class": "standard"
    },
    {
      "id": 64,
      "country": "US",
      "state": "ID",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 12,
      "class": "standard"
    },
    {
      "id": 65,
      "country": "US",
      "state": "IL",
      "postcode": "",
      "city": "",
      "rate": "6.2500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 13,
      "class": "standard"
    },
    {
      "id": 66,
      "country": "US",
      "state": "IN",
      "postcode": "",
      "city": "",
      "rate": "7.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 14,
      "class": "standard"
    },
    {
      "id": 67,
      "country": "US",
      "state": "IA",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 15,
      "class": "standard"
    },
    {
      "id": 68,
      "country": "US",
      "state": "KS",
      "postcode": "",
      "city": "",
      "rate": "6.1500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 16,
      "class": "standard"
    },
    {
      "id": 69,
      "country": "US",
      "state": "KY",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 17,
      "class": "standard"
    },
    {
      "id": 70,
      "country": "US",
      "state": "LA",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 18,
      "class": "standard"
    },
    {
      "id": 71,
      "country": "US",
      "state": "ME",
      "postcode": "",
      "city": "",
      "rate": "5.5000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 19,
      "class": "standard"
    },
    {
      "id": 72,
      "country": "US",
      "state": "MD",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 20,
      "class": "standard"
    },
    {
      "id": 73,
      "country": "US",
      "state": "MA",
      "postcode": "",
      "city": "",
      "rate": "6.2500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 21,
      "class": "standard"
    },
    {
      "id": 74,
      "country": "US",
      "state": "MI",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 22,
      "class": "standard"
    },
    {
      "id": 75,
      "country": "US",
      "state": "MN",
      "postcode": "",
      "city": "",
      "rate": "6.8750",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 23,
      "class": "standard"
    },
    {
      "id": 76,
      "country": "US",
      "state": "MS",
      "postcode": "",
      "city": "",
      "rate": "7.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 24,
      "class": "standard"
    },
    {
      "id": 77,
      "country": "US",
      "state": "MO",
      "postcode": "",
      "city": "",
      "rate": "4.2250",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 25,
      "class": "standard"
    },
    {
      "id": 78,
      "country": "US",
      "state": "NE",
      "postcode": "",
      "city": "",
      "rate": "5.5000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 26,
      "class": "standard"
    },
    {
      "id": 79,
      "country": "US",
      "state": "NV",
      "postcode": "",
      "city": "",
      "rate": "6.8500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 27,
      "class": "standard"
    },
    {
      "id": 80,
      "country": "US",
      "state": "NJ",
      "postcode": "",
      "city": "",
      "rate": "7.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 28,
      "class": "standard"
    },
    {
      "id": 81,
      "country": "US",
      "state": "NM",
      "postcode": "",
      "city": "",
      "rate": "5.1250",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 29,
      "class": "standard"
    },
    {
      "id": 82,
      "country": "US",
      "state": "NY",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 30,
      "class": "standard"
    },
    {
      "id": 83,
      "country": "US",
      "state": "NC",
      "postcode": "",
      "city": "",
      "rate": "4.7500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 31,
      "class": "standard"
    },
    {
      "id": 84,
      "country": "US",
      "state": "ND",
      "postcode": "",
      "city": "",
      "rate": "5.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 32,
      "class": "standard"
    },
    {
      "id": 85,
      "country": "US",
      "state": "OH",
      "postcode": "",
      "city": "",
      "rate": "5.7500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 33,
      "class": "standard"
    },
    {
      "id": 86,
      "country": "US",
      "state": "OK",
      "postcode": "",
      "city": "",
      "rate": "4.5000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 34,
      "class": "standard"
    },
    {
      "id": 87,
      "country": "US",
      "state": "PA",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 35,
      "class": "standard"
    },
    {
      "id": 88,
      "country": "US",
      "state": "PR",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 36,
      "class": "standard"
    },
    {
      "id": 89,
      "country": "US",
      "state": "RI",
      "postcode": "",
      "city": "",
      "rate": "7.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 37,
      "class": "standard"
    },
    {
      "id": 90,
      "country": "US",
      "state": "SC",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 38,
      "class": "standard"
    },
    {
      "id": 91,
      "country": "US",
      "state": "SD",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 39,
      "class": "standard"
    },
    {
      "id": 92,
      "country": "US",
      "state": "TN",
      "postcode": "",
      "city": "",
      "rate": "7.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 40,
      "class": "standard"
    },
    {
      "id": 93,
      "country": "US",
      "state": "TX",
      "postcode": "",
      "city": "",
      "rate": "6.2500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 41,
      "class": "standard"
    },
    {
      "id": 94,
      "country": "US",
      "state": "UT",
      "postcode": "",
      "city": "",
      "rate": "5.9500",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 42,
      "class": "standard"
    },
    {
      "id": 95,
      "country": "US",
      "state": "VT",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 43,
      "class": "standard"
    },
    {
      "id": 96,
      "country": "US",
      "state": "VA",
      "postcode": "",
      "city": "",
      "rate": "5.3000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": false,
      "order": 44,
      "class": "standard"
    },
    {
      "id": 97,
      "country": "US",
      "state": "WA",
      "postcode": "",
      "city": "",
      "rate": "6.5000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 45,
      "class": "standard"
    },
    {
      "id": 98,
      "country": "US",
      "state": "WV",
      "postcode": "",
      "city": "",
      "rate": "6.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 46,
      "class": "standard"
    },
    {
      "id": 99,
      "country": "US",
      "state": "WI",
      "postcode": "",
      "city": "",
      "rate": "5.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 47,
      "class": "standard"
    },
    {
      "id": 100,
      "country": "US",
      "state": "WY",
      "postcode": "",
      "city": "",
      "rate": "4.0000",
      "name": "State Tax",
      "priority": 1,
      "compound": false,
      "shipping": true,
      "order": 48,
      "class": "standard"
    }
  ]
}

Delete a Tax Rate

This API helps you delete a tax rate.

HTTP Request

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

JSON response example:

{
  "message": "Deleted tax"
}

View Tax Rate Count

This API lets you retrieve a count of all tax rates.

HTTP Request

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

JSON response example:

{
  "count": 48
}

Available Filters

Filter Type Description
tax_rate_class string Tax rates by class. eg: standard, reduced-rate or zero-rate

Tax - Classes

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

Taxes Properties

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
curl -X POST https://example.com/wc-api/v3/taxes/classes \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "tax_class": {
    "name": "Zero Rate"
  }
}'
var data = {
  tax_class: {
    name: 'Zero Rate'
  }
};

WooCommerce.post('taxes/classes', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'tax_class' => [
        'name' => 'Zero Rate'
    ]
];

print_r($woocommerce->post('taxes/classes', $data));
?>
data = {
    "tax_class": {
        "name": "Zero Rate"
    }
}

print(wcapi.post("taxes/classes", data).json())
data = {
  tax_class: {
    name: "Zero Rate"
  }
}

woocommerce.post("taxes/classes", data).parsed_response

JSON response example:

{
  "tax_class": {
    "slug": "zero-rate",
    "name": "Zero Rate"
  }
}

View List of Tax Classes

This API helps you to view all the tax classes.

HTTP Request

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

JSON response example:

{
  "tax_classes": [
    {
      "slug": "standard",
      "name": "Standard Rate"
    },
    {
      "slug": "reduced-rate",
      "name": "Reduced Rate"
    },
    {
      "slug": "zero-rate",
      "name": "Zero Rate"
    }
  ]
}

Delete a Tax Class

This API helps you delete a tax class.

HTTP Request

DELETE
/wc-api/v3/taxes/classes/<slug>
curl -X DELETE https://example.com/wc-api/v3/taxes/classes/zero-rate \
    -u consumer_key:consumer_secret
WooCommerce.delete('taxes/classes/zero-rate', function(err, data, res) {
  console.log(res);
});
<?php print_r($woocommerce->delete('taxes/classes/zero-rate')); ?>
print(wcapi.delete("taxes/classes/zero-rate").json())
woocommerce.delete("taxes/classes/zero-rate").parsed_response

JSON response example:

{
  "message": "Deleted tax_class"
}

View Tax Rate Count

This API lets you retrieve a count of all tax rates.

HTTP Request

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

JSON response example:

{
  "count": 3
}

Webhooks

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

Webhooks Properties

Attribute Type Description
id integer The webhook ID (post ID) read-only
name string A friendly name for the webhook, defaults to "Webhook created on <date>"
status string Webhook status, options are active (delivers payload), paused (does not deliver), or disabled (does not deliver due delivery failures). Default is active
topic string Webhook topic, e.g. coupon.updated. See the complete list
resource string Webhook resource, e.g. coupon read-only
event string Webhook event, e.g. updated read-only
hooks array WooCommerce action names associated with the webhook read-only
delivery_url string The URL where the webhook payload is delivered
secret string Secret key used to generate a hash of the delivered webhook and provided in the request headers. required write-only
created_at string UTC DateTime when the webhook was created read-only
updated_at string UTC DateTime when the webhook was last updated read-only

Delivery Properties

Attribute Type Description
id integer The delivery ID (comment ID)
duration string The delivery duration, in seconds
summary string A friendly summary of the response including the HTTP response code, message, and body
request_url string The URL where the webhook was delivered
request_headers array Array of request headers (see Request Headers Attributes)
request_body string The request body, this matches the API response for the given resource (e.g. for the coupon.updated topic, the request body would match the response for GET /coupons/{id})
response_code string The HTTP response code from the receiving server
response_message string The HTTP response message from the receiving server
response_headers array Array of the response headers from the receiving server
response_body string The response body from the receiving server
created_at string A DateTime of when the delivery was logged

Request Headers Properties

Attribute Type Description
User-Agent string The request user agent, defaults to "WooCommerce/{version} Hookshot (WordPress/{version})"
Content-Type string The request content-type, defaults to "application/json"
X-WC-Webhook-Topic string The webhook topic
X-WC-Webhook-Resource string The webhook resource
X-WC-Webhook-Event string The webhook event
X-WC-Webhook-Signature string A base64 encoded HMAC-SHA256 hash of the payload
X-WC-Webhook-ID integer The webhook's ID
X-WC-Webhook-Delivery-ID integer The delivery ID

Create a Webhook

This API helps you to create a new webhook.

HTTP Request

POST
/wc-api/v3/webhooks
curl -X POST https://example.com/wc-api/v3/webhooks \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "webhook": {
    "name": "An add to cart webhook",
    "secret": "my-super-secret-private-key",
    "topic": "action.woocommerce_add_to_cart",
    "delivery_url": "http://requestb.in/1exdwip1"
  }
}'
var data = {
  webhook: {
    name: 'An add to cart webhook',
    secret: 'my-super-secret-private-key',
    topic: 'action.woocommerce_add_to_cart',
    delivery_url: 'http://requestb.in/1exdwip1'
  }
};

WooCommerce.post('webhooks', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'webhook' => [
        'name' => 'An add to cart webhook',
        'secret' => 'my-super-secret-private-key',
        'topic' => 'action.woocommerce_add_to_cart',
        'delivery_url' => 'http://requestb.in/1exdwip1'
    ]
];

print_r($woocommerce->post('webhooks', $data));
?>
data = {
    "webhook": {
        "name": "An add to cart webhook",
        "secret": "my-super-secret-private-key",
        "topic": "action.woocommerce_add_to_cart",
        "delivery_url": "http://requestb.in/1exdwip1"
    }
}

print(wcapi.post("webhooks", data).json())
data = {
  webhook: {
    name: "An add to cart webhook",
    secret: "my-super-secret-private-key",
    topic: "action.woocommerce_add_to_cart",
    delivery_url: "http://requestb.in/1exdwip1"
  }
}

woocommerce.post("webhooks", data).parsed_response

JSON response example:

{
  "webhook": {
    "id": 535,
    "name": "An add to cart webhook",
    "status": "active",
    "topic": "action.woocommerce_add_to_cart",
    "resource": "action",
    "event": "woocommerce_add_to_cart",
    "hooks": [
      "woocommerce_add_to_cart"
    ],
    "delivery_url": "http://requestb.in/1exdwip1",
    "created_at": "2015-01-21T13:19:58Z",
    "updated_at": "2015-01-21T13:19:58Z"
  }
}

View a Webhook

This API lets you retrieve and view a specific webhook.

HTTP Request

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

JSON response example:

{
  "webhook": {
    "id": 535,
    "name": "An add to cart webhook",
    "status": "active",
    "topic": "action.woocommerce_add_to_cart",
    "resource": "action",
    "event": "woocommerce_add_to_cart",
    "hooks": [
      "woocommerce_add_to_cart"
    ],
    "delivery_url": "http://requestb.in/1exdwip1",
    "created_at": "2015-01-21T13:19:58Z",
    "updated_at": "2015-01-21T13:19:58Z"
  }
}

View List of Webhooks

This API helps you to view all the webhooks.

HTTP Request

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

JSON response example:

{
  "webhooks": [
    {
      "id": 535,
      "name": "An add to cart webhook",
      "status": "active",
      "topic": "action.woocommerce_add_to_cart",
      "resource": "action",
      "event": "woocommerce_add_to_cart",
      "hooks": [
        "woocommerce_add_to_cart"
      ],
      "delivery_url": "http://requestb.in/1exdwip1",
      "created_at": "2015-01-21T13:19:58Z",
      "updated_at": "2015-01-21T13:19:58Z"
    },
    {
      "id": 313,
      "name": "Webhook created on Jan 17, 2015 @ 11:45 AM",
      "status": "active",
      "topic": "order.created",
      "resource": "order",
      "event": "created",
      "hooks": [
        "woocommerce_checkout_order_processed",
        "woocommerce_process_shop_order_meta",
        "woocommerce_api_create_order"
      ],
      "delivery_url": "http://requestb.in/1exdwip1",
      "created_at": "2014-12-17T11:45:05Z",
      "updated_at": "2015-01-10T00:41:08Z"
    }
  ]
}

Available Filters

Filter Type Description
status string Webhooks by status. The following options are available: active or paused and disabled. Default is active

Update a Webhook

This API lets you make changes to a webhook.

HTTP Request

PUT
/wc-api/v3/webhook/<id>
curl -X PUT https://example.com/wc-api/v3/webhook/535 \
    -u consumer_key:consumer_secret \
    -H "Content-Type: application/json" \
    -d '{
  "webhook": {
    "status": "paused"
  }
}'
var data = {
  webhook: {
    status: 'paused'
  }
}

WooCommerce.put('webhooks/535', data, function(err, data, res) {
  console.log(res);
});
<?php
$data = [
    'webhook' => [
        'status' => 'paused'
    ]
];

print_r($woocommerce->put('webhooks/535', $data));
?>
data = {
    "webhook": {
        "status": "paused"
    }
}

print(wcapi.put("webhooks/535", data).json())
data = {
  webhook: {
    status: "paused"
  }
}

woocommerce.put("webhooks/535", data).parsed_response

JSON response example:

{
  "webhook": {
    "id": 535,
    "name": "An add to cart webhook",
    "status": "paused",
    "topic": "action.woocommerce_add_to_cart",
    "resource": "action",
    "event": "woocommerce_add_to_cart",
    "hooks": [
      "woocommerce_add_to_cart"
    ],
    "delivery_url": "http://requestb.in/1exdwip1",
    "created_at": "2015-01-21T13:19:58Z",
    "updated_at": "2015-01-21T13:19:58Z"
  }
}

Delete a Webhook

This API helps you delete a webhook.

HTTP Request

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

JSON response example:

{
  "message": "Permanently deleted webhook"
}

View Webhooks Count

This API lets you retrieve a count of all webhooks.

HTTP Request

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

JSON response example:

{
  "count": 4
}

Available Filters

Filter Type Description
status string Webhooks by status. The following options are available: active or paused and disabled

View a Webhooks Delivery

This API lets you retrieve and view a specific webhook delivery.

HTTP Request

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

JSON response example:

{
  "webhook_delivery": {
    "id": 378,
    "duration": "0.90226",
    "summary": "HTTP 200 OK: ok",
    "request_method": "POST",
    "request_url": "http://requestb.in/125q7ns1",
    "request_headers": {
      "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
      "Content-Type": "application/json",
      "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
      "X-WC-Webhook-Resource": "action",
      "X-WC-Webhook-Event": "woocommerce_add_to_cart",
      "X-WC-Webhook-Signature": "geC1akFhCtsO7fbXz5XiGUsMsRa4Mt0IJsZ96nTaHjI=",
      "X-WC-Webhook-ID": 535,
      "X-WC-Webhook-Delivery-ID": 378
    },
    "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"7cbbc409ec990f19c78c75bd1e06f215\"}",
    "response_code": "200",
    "response_message": "OK",
    "response_headers": {
      "connection": "close",
      "server": "gunicorn/18.0",
      "date": "Wed, 21 Jan 2015 16:22:49 GMT",
      "content-type": "text/html; charset=utf-8",
      "content-length": "2",
      "sponsored-by": "https://www.runscope.com",
      "via": "1.1 vegur"
    },
    "response_body": "ok",
    "created_at": "2015-01-21T16:26:12Z"
  }
}

View List of Webhooks Deliveries

This API helps you to view all deliveries from a specific webhooks.

HTTP Request

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

JSON response example:

{
  "webhook_deliveries": [
    {
      "id": 380,
      "duration": "0.58635",
      "summary": "HTTP 200 OK: ok",
      "request_method": "POST",
      "request_url": "http://requestb.in/125q7ns1",
      "request_headers": {
        "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
        "Content-Type": "application/json",
        "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
        "X-WC-Webhook-Resource": "action",
        "X-WC-Webhook-Event": "woocommerce_add_to_cart",
        "X-WC-Webhook-Signature": "st4egVCTwG1JMfxmxe7MZYEuj9Y6Euge4SOTNfCUCWY=",
        "X-WC-Webhook-ID": 535,
        "X-WC-Webhook-Delivery-ID": 380
      },
      "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"c16a5320fa475530d9583c34fd356ef5\"}",
      "response_code": "200",
      "response_message": "OK",
      "response_headers": {
        "connection": "close",
        "server": "gunicorn/18.0",
        "date": "Wed, 21 Jan 2015 16:23:05 GMT",
        "content-type": "text/html; charset=utf-8",
        "content-length": "2",
        "sponsored-by": "https://www.runscope.com",
        "via": "1.1 vegur"
      },
      "response_body": "ok",
      "created_at": "2015-01-21T16:26:28Z"
    },
    {
      "id": 378,
      "duration": "0.90226",
      "summary": "HTTP 200 OK: ok",
      "request_method": "POST",
      "request_url": "http://requestb.in/125q7ns1",
      "request_headers": {
        "User-Agent": "WooCommerce/2.3.0 Hookshot (WordPress/4.1)",
        "Content-Type": "application/json",
        "X-WC-Webhook-Topic": "action.woocommerce_add_to_cart",
        "X-WC-Webhook-Resource": "action",
        "X-WC-Webhook-Event": "woocommerce_add_to_cart",
        "X-WC-Webhook-Signature": "geC1akFhCtsO7fbXz5XiGUsMsRa4Mt0IJsZ96nTaHjI=",
        "X-WC-Webhook-ID": 535,
        "X-WC-Webhook-Delivery-ID": 378
      },
      "request_body": "{\"action\":\"woocommerce_add_to_cart\",\"arg\":\"7cbbc409ec990f19c78c75bd1e06f215\"}",
      "response_code": "200",
      "response_message": "OK",
      "response_headers": {
        "connection": "close",
        "server": "gunicorn/18.0",
        "date": "Wed, 21 Jan 2015 16:22:49 GMT",
        "content-type": "text/html; charset=utf-8",
        "content-length": "2",
        "sponsored-by": "https://www.runscope.com",
        "via": "1.1 vegur"
      },
      "response_body": "ok",
      "created_at": "2015-01-21T16:26:12Z"
    }
  ]
}

Authentication Endpoint

Starting in WooCommerce 2.4 we introduced an Authentication Endpoint, This can be used by any app to allow users to generate API keys. This makes integration with WooCommerce API simpler because the user only needs to access a URL and click "accept". After being redirected back to the app, the API keys will be sent in a POST request.

The following image illustrates how it's done:

Authentication Endpoint flow

URL parameters

Parameter Type Description
app_name string Your app name mandatory
scope string Level of access. Available: read, write and read_write mandatory
user_id string User ID in your app. For your internal reference, used when the user is redirected back to your app. NOT THE USER ID IN WOOCOMMERCE mandatory
return_url string URL the user will be redirected to after authentication mandatory
callback_url string URL that will receive the generated API key. Note: this URL should be over HTTPS mandatory

Creating Authentication Endpoint URL

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

Example of how to build an authentication URL:

# Bash example
STORE_URL='http://example.com'
ENDPOINT='/wc-auth/v1/authorize'
PARAMS="app_name=My App Name&scope=read_write&user_id=123&return_url=http://app.com/return-page&callback_url=https://app.com/callback-endpoint"
QUERY_STRING="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$PARAMS")"
QUERY_STRING=$(echo $QUERY_STRING | sed -e "s/%20/\+/g" -e "s/%3D/\=/g" -e "s/%26/\&/g")

echo "$STORE_URL$ENDPOINT?$QUERY_STRING"
var querystring = require('querystring');

var store_url = 'http://example.com';
var endpoint = '/wc-auth/v1/authorize';
var params = {
  app_name: 'My App Name',
  scope: 'read_write',
  user_id: 123,
  return_url: 'http://app.com/return-page',
  callback_url: 'https://app.com/callback-endpoint'
};
var query_string = querystring.stringify(params).replace(/%20/g, '+');

console.log(store_url + endpoint + '?' + query_string);
<?php
$store_url = 'http://example.com';
$endpoint = '/wc-auth/v1/authorize';
$params = [
    'app_name' => 'My App Name',
    'scope' => 'write',
    'user_id' => 123,
    'return_url' => 'http://app.com',
    'callback_url' => 'https://app.com'
];
$query_string = http_build_query( $params );

echo $store_url . $endpoint . '?' . $query_string;
?>
from urllib.parse import urlencode

store_url = 'http://example.com'
endpoint = '/wc-auth/v1/authorize'
params = {
    "app_name": "My App Name",
    "scope": "read_write",
    "user_id": 123,
    "return_url": "http://app.com/return-page",
    "callback_url": "https://app.com/callback-endpoint"
}
query_string = urlencode(params)

print("%s%s?%s" % (store_url, endpoint, query_string))
require "uri"

store_url = 'http://example.com'
endpoint = '/wc-auth/v1/authorize'
params = {
  app_name: "My App Name",
  scope: "read_write",
  user_id: 123,
  return_url: "http://app.com/return-page",
  callback_url: "https://app.com/callback-endpoint"
}
query_string = URI.encode_www_form(params)

puts "#{store_url}#{endpoint}?#{query_string}"

Example of JSON posted with the API Keys

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

Example of the screen that the user will see:

Authentication Endpoint example

Notes and Tips

This documentation is for the WooCommerce API v3 API which is now deprecated. Please use the latest REST API version.