Make a call to see if .myshopify.com link is valid

Make a call to see if .myshopify.com link is valid

TritonJK
Shopify Partner
16 0 2

Hello!

 

Is it possible to use the API to make a call that verifies that the .myshopify.com link our customer submits is a valid and existing link to a shopify account/store?

 

For example the customer enters random characters into a text field in our app and the response comes back "Not a valid .myshopify link" etc.

Replies 2 (2)

TritonJK
Shopify Partner
16 0 2

Bumping this

Liam
Shopify Staff
2873 312 821

What you could do is make a GET request to an endpoint that requires authentication, like GET /admin/api/2024-01/shop.json, using the submitted .myshopify.com domain. If the store exists and your app has the correct permissions, the API will return details about the store, confirming its existence.
If the store does not exist or the provided link is incorrect, the API will return an error, which you can then relay back to the user as "Not a valid .myshopify link".

Liam | Developer Advocate @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog