Hello!
I’ve noticed what seems to be different behavior between vanity and canonical shop URLs when fetching an access token via the /admin/oauth/access_token endpoint.
Here’s what I’m experiencing:
-
Initiate auth flow via https://vanity.myshopify.com/admin/oauth/authorize?client_id=CLIENT_ID&scope=SCOPES&redirect_uri=REDIRECT_URI
-
Shopify redirects user to canonical URL version: https://a1b2c3.myshopify.com/admin/oauth/authorize?client_id=CLIENT_ID&scope=SCOPES&redirect_uri=REDIRECT_URI
-
User authenticates, Shopify redirects back to REDIRECT_URI?code=CODE&shop=a1b2c3.myshopify.com
-
We use the code to then fetch an access token. Here’s where there is a difference b/w the two URLs:
- https://vanity.myshopify.com/admin/oauth/access_token → 401 error “[API] Invalid API key or access token (unrecognized login or wrong password)”
- https://a1b2c3.myshopify.com/admin/oauth/access_token → 200 success!

Is this expected? Is there a reason we can’t use the vanity URL when fetching an access token?
Thank you!