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.

Third-Party App callout from Checkout.liquid

Third-Party App callout from Checkout.liquid

JustinW
Shopify Partner
15 0 4

Hi,


I am trying to write to a metafield on the order from the checkout page. I have shopify plus, and an existing custom app that handles the api requests. The api handling was built using this as reference: https://github.com/Shopify/shopify-app-examples/tree/main/qr-code/node

The issue that I am facing is that the app does not handle proxy requests correctly. I get the following error: InvalidRequestError: Request does not contain a host query parameter 

This is ran through the proxy from Shopify side, and has worked for other requests from theme.liquid. Here is how I am handling proxy requests from express.js:

    if (Shopify.Context.IS_EMBEDDED_APP && req.query.embedded !== "1" ) {
      
      try{        
        const embeddedUrl = Shopify.Utils.getEmbeddedAppUrl(req);
        return res.redirect(embeddedUrl + req.path);
      }catch (error){
        console.log(error);
      }

    }

I also opened a github issue: https://github.com/Shopify/shopify-api-node/issues/609

Let me know if there's any other info that would help resolve this.

Helping customers integrate their E-Commerce and Salesforce data
Replies 0 (0)