How to set product recommendations with the API?

Hey,

I have an idea that might work, but I have not gotten around to trying it myself yet.

Apparently the Product Recommendations are controlled by a product metafield definition called product_recommendation.related_products

While there seems to be no direct API to set product recommendations, there is an API to assign metafield values. My plan is to try and fill a product’s metafield product_recommendation.related_products with ids for the products I want recommended.

Like I said though, this is just a plan right now, I can not verify that it works. If you get around to trying it sooner than me, I’d appreciate it if you let me know your results.

3 Likes