
Shopify for Craft CMS
Build a content-driven storefront by synchronizing Shopify products into Craft CMS.
[!IMPORTANT]
Please review the upgrade instructions for some important changes.
Topics
- :package: Installation: Set up the plugin and get connected to Shopify.
- :card_file_box: Working with Products: Learn what kind of data is available and how to access it.
- :bookmark_tabs: Templating: Tips and tricks for using products in Twig.
- :leaves: Upgrading: Take advantage of new features and performance improvements.
- :telescope: Advanced Features: Go further with your integration.
Installation
Shopify requires Craft CMS 5.10.7+.
To install the plugin, visit the Plugin Store from your Craft project, or follow these instructions.
Navigate to your Craft project in a new terminal:
cd /path/to/project
Require the package with Composer:
composer require craftcms/shopify -w
In the Control Panel, go to Settings → Plugins and click the “Install” button for Shopify, or run:
php craft plugin/install shopify
Connect to Shopify
The plugin works with Shopify’s Dev Dashboard app system, and is split into two primary parts: creating an app and performing authorization.
To install an app into a store, one of these statements must describe your account’s relationship with it:

[!CAUTION]
The new OAuth-based API connection requires that apps are created from an “organization” that has access to the Partner Dashboard.
Standalone stores (like the one created when you sign up for a Shopify account) belong to their own organization.
- If you are working with a store or account that has never accessed a Partner Dashboard, you must create a Partner profile before proceeding.
- When working from an account that has access to multiple organizations, it is generally safest to access the new Dev Dashboard via the Partner Dashboard you want the app associated with.
Create an App
- Navigate to your Dev Dashboard:
- From a store, open the account context menu (upper-right corner) and select Dev Dashboard;
- From the Partner Dashboard, open the account context menu (upper-right corner) and select Dev Dashboard;
- In the Dev Dashboard, press Create app.
- In the first screen, pick an App name that identifies the integration, like Craft CMS.
- Press Create, then fill out the following fields to create your first “version”:
App URL: Retrieve the Shopify App Auth URL value from the plugin’s setting screen in the Craft control panel. (This will always be your project’s URL, followed by the cpTrigger, then the action shopify/auth: https://my-project.com/admin/shopify/auth.)
Embed app in Shopify admin: Make sure this is unchecked, as the plugin does not support embedded apps.
Webhooks API Version: Choose 2026-01, and add the same string to your project’s .env file:
SHOPIFY_WEBHOOK_VERSION="2026-01"
Access → Scopes: The following scopes are always required:
read_inventory
read_product_listings
read_products
If you plan to enable any Additional Features or Custom Scopes in the plugin settings, those will require additional scopes. Once the plugin is installed and configured, use the read-only Scopes field in Shopify → Settings as the source of truth: it always reflects the full, comma-separated string to paste here.
[!WARNING]
If you later change your Additional Features or Custom Scopes settings, you must update the scopes in your Shopify app configuration and then re-authorize the app from the Craft control panel.
Do not enable the Use legacy install flow as it can result in mismatched scopes during installation.
- Press Release to deploy the configuration. You may give it a name and description, or let Shopify tag it with an incrementing number.
- Switch to the Settings screen of the new app, and copy the credentials into your
.env file:SHOPIFY_CLIENT_ID="..." # Client ID
SHOPIFY_CLIENT_SECRET="..." # Secret
Next, you’ll configure the app’s distribution scheme.
- From the new app’s Home screen in the Dev Dashboard, follow the Select distribution method link, within the Distribution widget.
- The Partner Dashboard will open, with your app selected. Choose Custom distribution, press Select, then confirm in the dialog box.
- Locate your store’s hostname (see screenshot, below), and paste it into the Store domain field, then press Generate link.
- Once you choose a hostname, the app is permanently locked to that store. If you do not provide the correct hostname at this stage, you’ll need to delete the app and start over.
- If you want to use the same connection across multiple related stores, check Allow multi-store install for one Plus organization.
- Take this opportunity to add the hostname to your
.env file:
SHOPIFY_HOSTNAME="my-store-name.myshopify.com"
- Return to the Distribution screen and press Copy link.

You should now have a total of four SHOPIFY_* variables in your .env file:
# 1. Webhook API Version
# This is tied to your app’s release, and should not change (except potentially during a future plugin upgrade).
SHOPIFY_WEBHOOK_VERSION="2026-01"
# 2. Client ID
# This can be found in your Shopify app’s Settings screen.
SHOPIFY_CLIENT_ID="..."
# 3. Secret
# This can be found in your Shopify app’s Settings screen.
SHOPIFY_CLIENT_SECRET="..."
# 4. Hostname
# Found in your store’s settings screen. Include only the domain (no leading `https://`)
SHOPIFY_HOSTNAME="my-store-name.myshopify.com"
In the Craft control panel, navigate to Shopify → Settings to configure the plugin:
- API Version:
$SHOPIFY_WEBHOOK_VERSION
- Client ID:
$SHOPIFY_CLIENT_ID
- Client Secret Key:
$SHOPIFY_CLIENT_SECRET
- Host Name:
$SHOPIFY_HOSTNAME
Use these literal strings in the corresponding fields.
As you type the $-prefixed value into an input, Craft will suggest matching variables.
Press Save to commit the settings to project config.
[!TIP]
You may see a warning below the read-only Shopify App Auth URL field.
This is expected, until you’ve completed the OAuth flow!
Install in a Store
In this step, we’ll perform the authorization code grant or OAuth flow, during which Craft and Shopify negotiate a long-lived access token.
[!TIP]
Whoever installs the app must be able to access to the store and the Craft project from the same browser.
Shopify does not need to directly contact the Craft, so you may do this from your local development machine!
- Visit the installation URL you copied from the Distribution screen in the Partner Dashboard. You must be logged in to a Shopify account with access to the target store (but it does not need to be the same account that created the app).
- Select the store in Shopify’s context picker.
- On the Install app screen within the store’s admin, review the permissions and press Install.
[!WARNING]
If you do not see a blue banner confirming This app is exclusive to your store, do not proceed!
A banner saying This app can’t be installed on this store (or landing on a generic Shopify error page) usually means that the hostname is not valid for the distribution.
- You will be redirected to the Craft control panel “auth” URL you used when creating the Shopify app. (If you were not already logged in, Craft will ask for your username and password; your user must have the Access Shopify permission or be an administrator to complete the authorization flow.)
- Confirm the store’s hostname and press Authorize in the dialog:

- Craft and Shopify will perform the OAuth handshake, and you should land on a confirmation screen in the Craft control panel saying Your Shopify app has been successfully authorized.
🎊 Congratulations! Your Craft project can now communicate with the Shopify API.
Let’s take it for a spin by importing your store’s products.
Set up Webhooks
A new Webhooks tab will appear in the Shopify section of the control panel once you’ve completed the authorization flow.
Click Create webhooks on the Webhooks screen to add the required webhooks to Shopify.
The plugin will use your newly-issued access token to perform this operation, so this also serves as an initial communication test.
[!WARNING]
You must add webhooks for every environment you deploy the plugin to; webhooks are tied to the specific, registered URL.
Be aware that Shopify will continue to attempt delivery to your development environment’s subscriptions, which may impact the statistics you see in the Dev Dashboard.
See Cleanup below for help culling unused webhook subscriptions.
Testing Webhooks
Development environments are not typically exposed to the public internet, which means Shopify won’t be able to deliver webhooks.
To test synchronization in development, we recommend using ngrok to create a tunnel to your local environment.
DDEV makes this simple, with the ddev share command.
[!TIP]
Use the SHOPIFY_PUBLIC_DEV_URL environment variable to override your project’s base URL when creating webhooks; this allows you to continue using your regular DDEV site URL for control panel and front-end access, rather than overriding the entire project or site’s base URL.
This setting may not work if you have set a custom cpBaseUrl!
Cleanup
Each time you open an ngrok tunnel, you get a new public URL, and Shopify will be unable to deliver webhooks.
This means that you may accumulate broken subscriptions over the course of development.
In the control panel, we only display the webhooks relevant to the current environment—or, more accurately, those with a uri matching the resolved webhook URL (which can be influenced by the SHOPIFY_PUBLIC_DEV_URL variable).
You can delete individual webhooks from the control panel, or by using the CLI GraphQL playground…
php craft shopify/api/query 'mutation deleteWebhook {
webhookSubscriptionDelete(id: "gid://shopify/WebhookSubscription/123456789") {
userErrors {
field
message
}
deletedWebhookSubscriptionId
}
}'
…substituting a known subscription GID.
Discover orphaned subscriptions using the webhookSubscriptions() query.
Upgrading