Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce REST API Custom Fields

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!

like image 542
Amjad Avatar asked Apr 02 '16 05:04

Amjad


1 Answers

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.

like image 127
Amjad Avatar answered Sep 23 '22 02:09

Amjad