How to get WooCommerce order meta from the new wp v1 API
-
We are using the latest WP/WooCommerce (just installed).
And we want to get the WC orders from the new wp api for wc (wc-api/v1/orders) using VB.Net on Windows Desktop.
The program can get the orders ok but the doc on using the filters and getting the meta is very unclear to me and we cannot get the meta nor use the filters.
Some parameters work as per_page and status,complete but most others do not. So it is my believe that I am just not using the filters and parameters correctly.
I am using list of orders as per the doc on
https://woothemes.github.io/woocommerce-rest-api-docs/#list-all-ordersI do not see a parameter to get meta but in some legacy doc I seen meta=true. Which I tried and did not get a meta tag for the order.
In most cases the parameters just do nothing. In others it generates errors as 401 unauthorized or 400 bad request.
Below are some of the things that I have tried. All the auth works (not included but I do get orders), per_page and status works but nothing else. So what am I doing wrong?
The doc has
filter string Use WP Query arguments to modify the response; private query vars require appropriate authorization.
But what is the format and what exactly is a ‘WP Query arguments’???
Is there some better doc?Please help.
Dim Parameters As New Dictionary(Of String, String) 'Parameters.Add("per_page", "100") ' WORKS 'Parameters.Add("filter[meta]", "true") 'ng 'Parameters.Add("order[order_meta]", "true") ' ng 'Parameters.Add("order[meta]", "true") ' ng 'Parameters.Add("order.order_meta", "true") ' 'Parameters.Add("order_meta", "true") ' 'Parameters("meta") = "true" 'Parameters.Add("order_meta", "1") ' ng 'Parameters.Add("order_meta", "0") ' ng 'Parameters.Add("meta", 1) ' ng 'parameters.Add("status", "completed") ' Works ' ng 401 unauthorized parameters.Add("filter[order_meta[aaatex_qb]]", "new") 'ng Parameters.Add("order_meta[aaatex_qb]", "xnew") 'Parameters.Add("filter[order_meta.aaatex_qb]", "new") ' ng Parameters("date_created") = "2016-09-20T00:00:00" ' ng Parameters("date_created") = "2016-09-20" ' ng Parameters("created_at_min") = "2016-09-03T00:00:00" 'Parameters("date_created_min") = "2016-09-03" 'Parameters("date_created_min") = "2016-09-03T00:00:00" 'parameters("filter[created_at_min]") = "2016-09-03" 'parameters("filter[created_at_max]") = "2016-08-30" ' 401 unauthorized with at min 'Parameters.Add("filter[meta[aaatex_qb]]", "new") ' aaatex ' causes a 401 unautherized ' ng Parameters.Add("filter[aaatex_qb]", "new") ' ng Parameters("filter[number]") = "3520"
- The topic ‘How to get WooCommerce order meta from the new wp v1 API’ is closed to new replies.