Shopify integration
What is Shopify?
Shopify is an e-commerce platform that helps users build and manage their online stores. It offers a wide range of features such as inventory management, payment processing and business marketing allowing you to easily boost sales and save time.
In addition to that, the platform provides Shopify App Store with various third party apps and integrations extending its functionality. Among its additional features you can find customizable templates known as "themes" that you can use for creating your e-commerce store.
Adding Shopify integration to Buddy allows you to automate various tasks tailored to your development needs.
You can e.g. create a pipeline that will update your Shopify themes on every push to branch.
Image loading...
On top of that, you can use Shopify CLI action for more advanced operations.
What is Shopify CLI?
Shopify CLI is a tool that allows developers to build Shopify apps and themes and interact with them using command-line interface. With the Shopify CLI action you can e.g. test, build or sync Shopify themes and apps directly from your pipeline in Buddy.
Here is an example of a pipeline that runs theme check before pushing it to the store, and sends a notification to the client's Slack channel at the end:
Image loading...
Setting up Shopify integration
- Navigate to the Integrations tab and click New integration.
- Look up and click Shopify (it can be found under the PaaS category):
Image loading...
- The configuration window will appear:
Image loading...
Here you have to provide:
- Integration name, e.g.
My Shopify stores
- Store URL and the Access Token or the API Key depending on the authorization method you have chosen for your integration
- Once done, click Add a new integration to add the integration to your roster.
Retrieving Shopify access token
To integrate Shopify using the access token:
- Log in to your Shopify account and select the store to which you want to deploy.
Go to your shop at:
admin.shopify.com/store/YOURSHOPNAME/settings/apps/development
- Click Create an app to add a new application.
Once added, click Configure Admin API scopes and select these scopes:
write_themes
read_themes
Image loading...
- Save changes and click Install app to add it to your store.
- Copy the newly generated token and paste it in Buddy to finish configuration.
Image loading...
Obtaining Shopify Partner Token and API key
Another authorization method to integrate Shopify is by providing Partner Token and API Key (Theme Token).
Image loading...
- In your Partner Dashboard in Shopify, go to Settings → CLI token, and click Manage tokens.
- Click Generate new token and select the appropriate access for your authentication token:
- UI extensions: For UI extensions, including Checkout UI, Post-purchase UI, Subscription UI, and Web pixel.
- Functions: For Shopify Functions-based extensions such as order, product, or shipping discounts.
After the token is created, these permissions can't be changed.
- Select an expiration for the token from the dropdown list and click Generate token.
- In the Tokens section, click the Copy button to copy the token to your clipboard.
- For each online store that you want to interact with directly via CLI, you need to get a Theme Access password. These are generated using the Theme Access app.
- Paste the generated CLI token in the Partner Token field and the Theme Token in the API KEY field in the configuration window.
Last modified on Sep 23, 2024