I'm using the WooCommerce REST API (http://woocommerce.github.io/woocommerce-rest-api-docs/#introduction) and are able to download Customers, Orders etc successfully. I would now like to just download a list of Orders between 2 dates - I can see in the docs for Orders the following parameters:
after string Limit response to resources published after a given ISO8601 compliant date.
before string Limit response to resources published before a given ISO8601 compliant date.
I've modified the URL for the request to this:
https://mywebsite.com/wp-json/wc/v1/orders?after=2016-08-05&before=2016-08-06&page=1
but I'm getting a 400 error with this response:
{
"code": "rest_invalid_param",
"data": {
"params": {
"after": "The date you provided is invalid.",
"before": "The date you provided is invalid."
},
"status": 400
},
"message": "Invalid parameter(s): after, before"
}
The 2 dates are valid ISO8601 compliant dates as far as I can tell. Can't find an example of how this request should look so not sure where to go from here.
It turns out you need to also specify the time, e.g.
after=2016-11-20T13:57:31.2311892-04:00
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With