Get products with multiple brands

reactjs

#1

I want to get products of multiple brands. Is there any way to get the products of desired in a single API call?
We can get the products of only one brand but I want to get products of multiple brands.


#2

Hi @culeneji-3754yopmai

Welcome to the moltin forum! :wave:

I’ll go ahead and suggest to the team that it would be useful to add some functionality that allows you to get products by multiple Brand IDs.

But for now you can obtain all products and associated brands via the following API call:

https://api.moltin.com/v2/products?include=brands

This will return products with “included” brands array, which include more details about the brand including name, slug, description, timestamps etc.

OR if you’re using the JS SDK…

Moltin.Products.With(['brands'])
  .All()
  .then(products => {
    res.json(products);
  });

From here you can handle any filtering/sorting client side to group the products as you wish.

I hope this helps :smile:


#3

This is as same as getting whole products and getting brands. But we need the products of selected brands only.


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.