WooCommerce REST API Custom Fields

Amjad picture Amjad · Apr 2, 2016 · Viewed 15.6k times · Source

Is it possible to access custom fields for orders, products, customers via WooCommerce REST API? If not natively, then what plugins or workarounds or hacks are out there that work? Thanks!

Answer

Amjad picture Amjad · Apr 8, 2016

Answering my own question:

It is possible using the following: (using v3 legacy API)

To send custom fields back to the server: (For Orders)

{
  "order_meta": {
     "key": "value"
  }
}

To retrieve custom fields from server use this filter with your end point:

http://www.example.com/wc-api/v3/orders?filter[meta]=true

This works for Products as well.