skip to Main Content

https://example.com/wp-json/wc/v3/products/10 product type=variable and it is working fine

https://example.com/wp-json/wc/v3/products/11 product type=variation and it is working fine

But it fetch only one product (with id 10) using include parameter like

https://example.com/wp-json/wc/v3/products?include=10,11

I need help so that i can fetch 2 or more products (any type) in one API call

2

Answers


  1. Do you need to retrieve all the products in woo commerce. If try with this call ” /wp-json/wc/v3/products”

    Login or Signup to reply.
  2. A bit late but maybe someone has the same problem still

    The include parameter should be array and as this thread explains How to pass an array within a query string?

    you should send your parameters as this

    https://example.com/wp-json/wc/v3/products?include[]=10&include[]=11
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search