Hi
First off, kudos for making integration from one backend-system to another overcomplicated and cumbersome 
I’ve run into an issue where a custom app isn’t allowed to be installed.
Our setup is just what is described by Shopify’s AI.
(Except step 2, we prepare and construct the URL in our backend so the user doesn’t need to concern himself with that. They click an “Install in Shopify”-button which will redirect them to the authorize URL)
I have one merchant who followed these steps and successfully installed his custom app.
Then there is another merchant, who seems to have 2 .myshopify.com addresses.
One is a proper name like merchant.myshopify.com and the other is in the pattern xxxxxx-xx.myshopify.com (which I assume is the original account name)
For the second merchant, I created two different customs apps, one for merchant.myshopify.com and one for xxxxx-xx.myshopify.com yet both will show up as “Not allowed / Can not be installed” when going to the authorize url.
I noticed that when going to xxxxx-xx.myshopify.com/admin/oauth/authorize there will be a lot of redirects and actually going to merchant.myshopify.com
Same thing happens but vice versa when first going to merchant.myshopify.com/admin/oauth/authorize
Now, if the merchant first use the installation link created when binding the custom app to a merchant, and after that let the merchant press “Install in Shopify”-button in our system, the processes will work, with the same authorize url.
So, why didn’t it work for the second merchant?
My theory is that is has todo with second merchant have multiple myshopify.com-addresses.
Hi @andersb,
How the app is installed depends on a few different variables with the app and store installing it.
When relying on AI conversations, I always recommend reviewing the documentation for the topics its discussing to verify what it’s telling you to ensure no AI hallucinations are occurring.
In this case, there’s a few different installation methods, and we’d need to confirm which is correct for your app:
-
How the merchant initiates the installation depends on who created the app, and it’s distribution method.
If the app was created in the Dev Dashboard while logged into a Merchant Account, there’s no option to select the distribution method type, and it’s automatically considered a Custom Merchant App.
The merchant will need to install it on the store by clicking the install button in the Dev Dashboard, which will redirect them to the Shopify login module to select the store they install the app on.
If the app was created in the Dev Dashboard while logged into a Partner Account, to install it on a non-development store you will need to select the distribution method, which will redirect you to the Partner Dashboard, where you can select Custom or Public distribution methods.
If you select Custom, you will need to enter the store’s .myshopify.com URL, though it doesn’t matter if you enter a branded .myshopify.com, or the default .myshopify.com URL.
If you then click the Generate Link button, this will create the installation link that you need to share with the merchant so they can install the app on the store. The link it generates uses the default shop name.
You can also select here Allow multi-store install for one Plus Organization and it will instead generate an install link that allows the merchant to install the app on any shop within the same Plus Org.
-
In all cases, when you create the app in the Dev Dashboard, there is the option to select Use Legacy Install flow, and if creating the app via the Shopify CLI, this is specified in the toml configuration file.
This will determine if the installation is managed by Shopify automatically, or if you need to do the redirects mentioned in the chat per the Authorization Code Grant workflow. This also determines how access scopes are set for the app, either through the oauth request for Authorization Code Grant, or through the app configuration in the Dev Dashboard or toml config file for Shopify Managed Installations.
If you are using the Authorization Code Grant install workflow, you should make sure that you are making the oauth requests to the default .myshopify.com url, not the branded domains. To ensure you’re using the correct domain, you can simply use the store name provided in shop parameter in the initial installation GET request you receive from Shopify in Step 1 of the Authorization Code Grant documentation I linked above.
I hope this all helps, and if you have any more specific questions about this, please let me know, and if you’d like us to help look into unexpected behaviour when installing your app on stores, I’d suggest reaching out to our Shopify Help Center with more details on the app and store it’s occurring on, and we can help you further in a fully authenticated support interaction.