Custom domain to call API

Topic summary

Issue: API calls (REST and GraphQL) must use the original xxx.myshopify.com domain. Custom domains don’t work for POST requests because they return a 301 redirect, which doesn’t preserve the HTTP method.

Question raised: Can Shopify change the redirect code to 308 to retain the request method?

Official response: Apps should always use the shop’s permanent .myshopify.com domain, not custom domains, for API requests. The permanent domain can be retrieved from:

  • GraphQL: Shop.myshopifyDomain field
  • REST: shop.myshopify_domain property

Status: The request has been logged with developers, but no commitment to change current behavior. Users are advised to subscribe to the changelog and quarterly API release notes for potential future updates.

Resolution: Use permanent myshopify.com domains for all API calls rather than custom domains.

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

For now, we always need to use the original xxx.myshopify.com domain to call REST or GRAPHQL endpoint. I tried adding a custom domain and throw into REST/GRAPHQL, but it doesn’t work for POST HTTP requests. The redirect code returned is 301 (which does not retain the original request’s method). Is it possible for Shopify to change the redirect code to 308 so that the request’s method is retained?

Custom domain: brandnewbiu.myshopify.com
Original domain: 361dee.myshopify.com

Hi @LeeHM ,

Apps should use the shop’s permanent domain rather than a custom domain to ensure that your API requests are handled with the expected HTTP method.

This can cause some confusion with shops that decide to use a new myshopify.com domain, as a custom/primary domain, but the permanent domain should always be listed on the shop object’s myshopifyDomain field, or the Shop.myshopify_domain in the REST Admin API.

I have logged your request with our developers, but can’t offer any other insights on if, or when, this behaviour could be changed, so make sure to subscribe to our changelog and review our quarterly API updates in case anything changes.

Hope that helps!

  • James