App Proxy is changing POST calls into GET calls

Topic summary

A developer is experiencing an issue where POST requests sent to their Shopify App Proxy are being converted to GET requests for certain stores. The app proxy is configured with subpath prefix \

Summarized with AI on November 10. AI used: claude-sonnet-4-5-20250929.

Hi there,

I’m facing a very strange problem at this moment with the App Proxy for my public Shopify app.

I have several stores which have my public app installed. A third party is sending POST webhooks to the app to update some data. But for some stores, this POST call was changed into a GET call.

App Proxy setup:

So when I POST call “https://shop.myshopify.com/apps/webhooks/magic-trick” with some payload, I receive a GET call instead for some specific stores…
I have no clue what’s wrong.

Both POST and GET have shop, path_prefix, timestamp and signature set and came clearly via the App Proxy.

Please reach out to me if you need more details.

1 Like

Hi,

You are in charge here, not Shopify. If you set up a POST callback in your front-end, you will get a POST call to your App. Expect it. If you set up a GET call in your front-end, your back-end App will receive a GET. Except it.

Shopify could care a less what call you make, it is up to you.

Hi,

If you make a POST to the myshopify.com subdomain, and a redirect to the primary domain is active. This might change the POST to a GET.

Try POSTing to the primary domain.

Best regards,

Jonathan

1 Like

Yeah, this is correct.

When the url is taking you to an App Proxy, you have to make sure that the primary domain is used.

Thanks @JonathanEsign !

The pattern of use is to make callbacks to a relative resource, as in:

/tools/thing

/a/thing?id=123

/community/thing?shoe=fatty&bleep=green

Note that there is zero need to involve any domains. It is a PROXY! Shopify knows what to do to the calls. If you include the domain in your front-end, you’re doing something wrong, and the results will likely be less than stellar.

1 Like

JonathanEsign’s answer is correct, but I didn’t understand how to implement the suggested fix at first. But after some experimentation, I figured out what I had to do.

Previously, in my app-block I was constructing my Shopify app’s base url from the window.location.origin, as shown below:

function makeAppBaseUrl () {
  const baseUrlString = window.location.origin;
  const baseUrl = new URL(baseUrlString)
  return new URL('/apps/appName/', baseUrl)
}

However, I noticed that window.location.origin was always the store-name.myshopify.com domain. This meant that the app would then redirect to the store’s primary domain (e.g., store-name.com), which caused the issue where POST requests were converted to GET requests.

To resolve this, I needed to retrieve the store’s primary domain directly to avoid the redirect. So I made the following changes:

In my app-block.liquid file, I found you can retrieve the primary domain via the shop.domain attribute. Then I passed in this attribute to an HTML element so that I could later access it in my app.js file. Here’s what my app-block.liquid file looks like:


  

And then in my app.js file, I created the following function to retrieve the store’s primary domain that I passed into the div above, and then used this domain to generate the app base url:

function makeAppBaseUrl () {
  const shopDomain = document.getElementById("container").dataset.shopDomain
  const baseUrlString = 'https://' + shopDomain;
  const baseUrl = new URL(baseUrlString)
  return new URL('/apps/appName/', baseUrl)
}

Now, my POST requests get received in my app server as POST requests, like they should. Hope this helps anyone with this issue.

You don’t need to add the domain, at all, just the path, after the domain. The system will look for a match, against the App Proxy sub path and sub path prefix and then forward to the App Proxy URL.

So, your fetch() URL, only needs to look like this:

/sub_path/sub_path_prefix/app_route_path