Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: "No shop provided" for anything but product count request in embedded sample app

"No shop provided" for anything but product count request in embedded sample app

Guybrush_shopz
Shopify Partner
5 0 3

Apologies for double- or at least 1.5-x-posting but I cannot move my original post and I don't think it'll get visibility in its location 😬

 

I've tried a bunch of other things since then but no luck. Here's the gist: The embedded app from the tutorial calls ´products/count´ via

 useAppQuery({
url: "/api/products/count", // that's the only important part

but whenever I try any other REST endpoint (products, orders, products/all) I receive a 400 BAD REQUEST response with a "no shop provided" body. How do I "provide" the shop and why? This is all happening from within an embedded app and obviously none of the other parameters change between count and the broken one (minus some time-stampy things).

Reply 1 (1)

masterBrog
Shopify Partner
17 0 4

I've been having the same problem with the QRCode sample app and just got it working. I don't have any explanation other than maybe there is a caching issue. But first i renamed an existing endpoint (might not be necessary) and restarted the app and then removed all other api middlewares from express and just added my new endpoint and now it works.

 

app.use("/api/*", shopify.validateAuthenticatedSession());

app.use(express.json());

// applyQrCodeApiEndpoints(app);
// applyQrCodePublicEndpoints(app);
applyOrdersApiEndpoints(app); // new endpoints

I imagine i could now add the other endpoints back in perhaps although i haven't tried that.