POS ProdutSearchAPI searchProducts only returning 1 variant per product

I’m using the ProductSearchAPI and I need to return the products and their variants based on a search term:

const results = await api.productSearch.searchProducts({ queryString })

However, the above api call only returns the first variant for each product. As an example, I’ll search for the term HMG. I have a product call HMG Basecoat that has 4 variants, as shown below:

When using the queryString hmg in the searchProducts endpoint, the following is returned:

Notice how only 1 variant is returned in the variants array, even though numVariants is correct with 4. This is happening with multiple products. How do I fix this to return all variants associated with a product?

Hey @21O - thanks for mentioning this. I’ll do a little digging on my end here and loop back with you once I can confirm expected behaviour :slight_smile:

Thanks @Alan_G, I look forward to hearing back from you. I’m really hoping it’s a bug and the expected behaviour isn’t to only return 1 variant… that would seem a little pointless.

Thanks,
Joe

Hi @Alan_G - did you get a chance to investigate this issue?

Cheers,
Joe