About REST Admin API authentication 's {shop} parameter

Hi,

I have a question regarding REST Admin API authentication for Shopify.

As per the documentation found here: https://shopify.dev/docs/apps/auth/admin-app-access-tokens, in order to make an authenticated request, I need to access the following URL:

https://{shop}.myshopify.com/admin/api/2023-07/products.json

However, I’m a bit uncertain about how to obtain the {shop} parameter. I understand that it is created during the initial setup as the shop name or store subdomain and is displayed as part of the store domain. But, I am wondering what would happen if I were to change the shop name or add a third-party domain to my shop. How would that affect the {shop} parameter used in the API URL?

Any clarification you can provide on this matter would be greatly appreciated. Thank you in advance for your assistance.

Hello @c_connect ,

Thank you for reaching out to the Shopify community.

The “shop” parameter is essential for interacting with Shopify’s API. When you install a Shopify public app, Shopify provides this parameter automatically after the app installation, or you can find this from shopify store url. For custom apps, you can find the “shop” URL in two ways:

  1. If your store’s default domain is “cheetos.myshopify.com,” then the “shop” parameter would be “cheetos.” the endpoint will look like “https://cheetos.myshopify.com/admin/api/2023-07/products.json.”

  2. If you have connected a custom domain like “sale.cheetos.com,” then the endpoint will look like this: “https://sale.cheetos.com/admin/api/2023-07/products.json.”

To ensure everything works smoothly, please keep in mind the following:

  • For public apps: Include the access token in the header and label it as “X-Shopify-Access-Token.”

  • For custom apps: Use basic authentication to pass the access token.

If you have any more questions or need further assistance, feel free to ask!

Thanks.