Skip to main content

Bring your own headless stack

Flow chart of a headless architecture built on Shopify. A developer uses the Shopify admin to control access to the Storefront API and Customer Account API. Those API resources are then rendered to display to customers.

Shopify’s composable commerce APIs allow you to integrate Shopify into nearly any technology stack, so you have the freedom to use the frameworks, hosting, and workflows that work best for you.


Anchor to Install the Headless channelInstall the Headless channel

To start accessing the Storefront API and the Customer Account API, you need to install the Headless channel from the Shopify App Store.

This channel gives you a single place to manage API access for all your client applications. It enables you to publish products to the Headless sales channel, as well as manage API permissions and credentials.

Info

If you want to display products on an existing site or platform, you can skip installing the Headless channel and use Storefont Web Components instead.


You can create multiple storefronts in the Headless channel.

Each storefront has its own set of API tokens, but all storefronts in the Headless channel share the same API permissions.

  1. From your Shopify admin, under Sales channels, click Headless.
  2. Click Add storefront.
  3. (Optional) On the storefront detail page, click Rename to edit the storefront’s default name.

Anchor to Manage API permissionsManage API permissions

You can control which store data is available through the Storefront or Customer Account APIs. All storefronts in the Headless channel share the same API permissions.

  1. From your Shopify admin, under Sales channels, click Headless.
  2. Click the name of the storefront that you want to update.
  3. Under Manage API access, click Manage for the API that you want to update.
  4. Under Permissions, click the edit icon.
  5. Check the permission scopes that you want enabled.
  6. Click Save.

Anchor to Rotate API credentialsRotate API credentials

For security purposes, you can update your API credentials at any time.

  1. From your Shopify admin, under Sales channels, click Headless.
  2. Click the name of the storefront to update.
  3. Under Manage API access, click Manage for the API that you want to update.
  4. Under Rotate credentials, click Generate new token. Both the old and new credentials are valid until you delete the old credentials.
  5. Update your client apps with the new credentials.
  • The Storefront API access relies on an API token.
  • The Customer Account API might have a Client ID and a Client Secret, depending on the type of access.
  1. After you’ve updated your apps, delete the old credentials by clicking Revoke.

The standard format for product URLs is /products/:handle. If your storefront uses a different structure, then it's recommended that you provide a server-side redirect (3XX) from the expected /products/:handle path to the product page.

It's also recommended that your storefront supports cart permalinks. View example implementation


Deleting a storefront in the Headless channel revokes all its access tokens. You need to update any clients using those tokens.

  1. From your Shopify admin, under Sales channels, click Headless.
  2. Click the name of the storefront that you want to delete.
  3. Click Delete storefront.
  4. To confirm, click Delete storefront.

From here, what you build is up to you! The Storefront API and the Customer Account API provide a wide selection of commerce primitives that enable you to integrate Shopify into your existing tech stack, or create something new.


Was this page helpful?