I want to retrieve purchasable products using API v3 and OAuthRequest. There is no clue in official document
I could get some other feature such as
/wp-json/wc/v3/products/?status=publish
but I don’t know anything more specific.
In the JSON object there is a “purchasable” flag when retrieve products, but I want to specify this in the request URL.
Thanks in advance.
2
Answers
No, filtering a product via purchasable flag is not supported by the API v3. You have to retrieve the products and filter them via purchasable flag manually when the response is returned to you.
as touhid said. you need to add a simple if or filter product.purchasable == true in your response data.