A developer integrating Shopify products into a .NET 7 application encountered a “forbidden” error when attempting to use Shopify’s recommendation endpoint via their custom app’s API.
Solution provided:
Switch from the standard API to the Storefront API, which is specifically designed for product recommendations rather than the AJAX API used in Liquid stores.
Implementation issues:
Initial attempts with the productRecommendations GraphQL query from documentation failed with “Field ‘productRecommendations’ doesn’t exist on type ‘QueryRoot’” error.
Testing simpler queries (like getProductById) from the same documentation worked fine.
Resolution:
After making corrections and properly configuring the Storefront API, the developer successfully resolved all issues and got recommendations working.
Summarized with AI on November 14.
AI used: claude-sonnet-4-5-20250929.
Hi, So i’m going to use shopify as a storage for my products, I’m going to retrieve them by API in my .net app, I’ve created custom shopify app for it, retrieved access token and all seems to work as expected.
Except the recommendation endpoint, I’d like shopify to also return a recommended products for given product but when I call recommendation endpoint it returns me “forbidden”.
Here the endpoint that I’m trying to call:
string apiUrl = $“{usersMyShopifyUrl}recommendations/products.json?product_id={product.Items.FirstOrDefault().Id}”;