Skip to main content

Setup Guide

This guide walks you through creating a Shopify app and connecting it to Paragon. Once you have finished your integration and are ready to list it on the Shopify App Store, jump to Publishing your Shopify app.

Setting Up Your Shopify Environment

Before creating your app, you’ll need a Shopify Partner account, a development store, and Shopify CLI.
Already have a Partner account, development store, and Shopify CLI? Skip to Creating a Shopify App.

1. Create a Partner account

Sign up for a Shopify Partner account. You will use this account to create apps in the Dev Dashboard.

2. Create a development store

In the Dev Dashboard, go to Stores and select Create store. See Shopify’s documentation on creating a development store for details.

3. Install Shopify CLI

Install Shopify CLI using npm (requires Node.js 22.12 or higher):
Or see Shopify’s CLI installation guide for other installation methods.

Creating a Shopify App

Shopify apps are configured in a shopify.app.toml file and deployed with Shopify CLI. You’ll create the app, set OAuth URLs, scopes, and mandatory compliance webhooks, then deploy.
1

Create the app

Open the Dev Dashboard and select Apps > Create app > Start from Dev Dashboard. Name your app and select Create.
If you prefer to scaffold a local project first, run shopify app init instead. That command creates both the app and a shopify.app.toml file, so you can skip the next step.
2

Link a local configuration file

In an empty directory (or your app project), run:
Select the app you just created. This generates a shopify.app.toml file you will use for the rest of setup.
3

Configure URLs, scopes, and compliance webhooks

Copy the Webhook URL from Integrations > Shopify > Settings in the Paragon dashboard. If Shopify is not in your catalog yet, add it first so the Settings tab is available.
Copying the Shopify webhook URL in Paragon
Open shopify.app.toml and set the following values. Keep any client_id that shopify app config link already wrote.
shopify.app.toml
If your file already has a [webhooks] section, keep its api_version and add only the [[webhooks.subscriptions]] block.
For on-premise installations, use https://passport.[Your Base URL]/oauth as the redirect URL.
Learn more in Shopify’s app configuration and privacy compliance docs.
4

Deploy the configuration

From the directory that contains shopify.app.toml, run:
Shopify registers your OAuth URLs, scopes, and compliance webhook subscriptions when you deploy. Repeat this step whenever you change those values.
5

Install the app on your development store

In the Dev Dashboard, open your app, go to Home, and select Install app. Choose the development store you created earlier and install.You must be the store owner or have a staff account on the store to install.

Add Your Shopify App to Paragon

After creating your Shopify app, enter its Client ID and Client Secret into Paragon.
1

Get your Client ID and Client Secret

In the Dev Dashboard, open your app and go to Settings. Copy the Client ID and Client secret.
2

Add your credentials to Paragon

  1. Select Shopify from the Integrations Catalog.
  2. Under Integrations > Connected Integrations > Shopify > App Configuration > Configure, fill in your credentials:
    Configuring Shopify client credentials in Paragon
Press Save Changes to save your credentials.
You should only add the scopes you’ve requested in your Shopify app.

Testing Your Setup

Open the Connect Portal for Shopify inside of your app, or click Test Connect Portal in the Shopify integration, and connect the development store you installed the app on.

Connecting to Shopify

Once your users have connected their Shopify account, you can use the Paragon SDK to access the Shopify API on behalf of connected users. See the Shopify REST API documentation for their full API reference. Any Shopify API endpoints can be accessed with the Paragon SDK as shown in this example.

Building Shopify workflows

Once your Shopify account is connected, you can add steps to perform the following actions:
  • Get Customers
  • Search Customers
  • Create Customer
  • Update Customer
  • Get Orders
  • Create Order
  • Update Order
  • Get Abandoned Carts
  • Get Products
  • Create Product
  • Update Product
You can also use the Shopify Request step to access any of Shopify’s API endpoints without the authentication piece. When creating or updating records in Shopify, you can reference data from previous steps by typing {{ to invoke the variable menu.

Using Webhook Triggers

Requirement for using Shopify triggers: Configuring triggers for Shopify events that involve customer data requires you as the Shopify app owner to request access to protected data. Navigate to Apps > Your App > API Access > Access Requests to request access before using the Paragon Shopify trigger. Learn more here.
Webhook triggers can be used to run workflows based on events in your users’ Shopify account. For example, you might want to trigger a workflow whenever new orders are created Shopify to sync your users’ Shopify orders to your application in real-time.
You can find the full list of Webhook Triggers for Shopify below:
  • New Order
  • Order Updated
  • New Customer
  • Customer Updated
  • New Product
  • Product Updated
  • Customer Data Request
  • Customer Data Erasure Request
  • Shop Data Erasure Request

Publishing your Shopify app

Required for publishing: In order to list your app on the Shopify App Store, you must implement the following additional features in your integration:For more information, see Shopify’s documentation on publishing requirements.

Setting up Redirect Pages in your app

Your Shopify integration requires two types of pages hosted in your application to support an installation flow that begins in the Shopify App Store (i.e., a user searches the Shopify App Store for your published app and clicks Add app). Here is an annotated version of the Shopify OAuth flow diagram outlining what pages you will need to implement:
The pages you will need to implement include:
  • Initial Redirect: This page will take in a shop query parameter and redirect to Shopify’s OAuth flow.
  • Redirect Callback: This page will receive the OAuth authorization code after the Shopify user grants consent and call paragon.completeInstall to save the user’s account connection.
For an example implementation of the redirect pages using React (based on our Next.js sample app), see:

Initial Redirect

The Initial Redirect should be implemented as follows:
  • Accept and read the query parameter shop. If the query parameter is present, redirect to the following URL to start the Shopify OAuth flow:
  • The SHOPIFY_CLIENT_ID should match the Client ID that you use in your Shopify integration settings.
  • The REDIRECT_CALLBACK_URL should be the URL of the Redirect Callback page in your app.
  • The SHOPIFY_SCOPES should match the scopes that you use in your Shopify integration settings.

Redirect Callback

The Redirect Callback should be implemented as follows:
  • Import the Paragon SDK and authenticate a user.
    • Note: If a user is not yet logged into your app, you can redirect to a login form, while preserving the intended URL to redirect to upon successful login. In other words, after logging in, your user should see your Redirect Page.
  • Accept and read query parameters, which will be:
    • code and shop in case of a successful installation
    • error in case of an unsuccessful installation or denied consent
  • If the code query parameter is present,
    • Read the shop query parameter and capture the shop name in the pattern {shop}.myshopify.com. See the regular expression used below.
    • Call paragon.completeInstall to complete the OAuth exchange and save a new connected Shopify account.
  • If the error query parameter is present,
    • Show this error in your app and allow your user to retry the process.

Updating your app’s redirect and app URLs

When your redirect pages are ready, update shopify.app.toml and deploy:
  1. Set application_url to your app’s Initial Redirect URL.
  2. Add your Redirect Callback URL to redirect_urls.
  3. Run shopify app deploy.
shopify.app.toml

Creating workflows to respond to privacy webhooks

Shopify requires apps listed on the Shopify App Store to handle three privacy events: customer data requests, customer data erasure, and shop data erasure. If you followed the Setup Guide, your app is already subscribed to those topics in shopify.app.toml. Paragon’s Shopify integration lets you take action on the events with workflows. Create 3 workflows that listen for these triggers:
  • Customer data request
  • Customer data erasure
  • Shop data erasure
You can create new workflows in the Paragon dashboard, from the Overview tab of your Shopify integration and click Create Workflow. For each of the new workflows you create, select a Shopify trigger and select one of the Shopify privacy webhook events as the Trigger Event:
Define the steps under the workflow to respond to the event type you selected. From Shopify’s documentation, here is how you should handle each event type:
  • Customer data request: If your app has been granted access to customer or order data, then it will receive a data request webhook. The webhook contains the resource IDs of the customer data that you need to provide to the store owner. It’s your responsibility to provide this data to the store owner directly.
    • Note: This request does not require the data to be provided in a response to the webhook. This process happens outside of Shopify and should be provided to the user who connected this Shopify account directly, e.g. through email, within 30 days of receiving the request.
  • Customer data erasure: Shopify store owners can request that data is deleted on behalf of a customer. When this happens, Shopify sends a Customer Data Erasure event to the apps installed on that store so that you can erase any data for a certain customer of a store from your database.
  • Shop data erasure: 48 hours after a store owner uninstalls your app, Shopify sends a Shop Data Erasure event. This webhook provides the store’s shop_id and shop_domain so that you can erase data for that store from your database.
Example implementationAdd a Request step under the Trigger to send the privacy event information to your API. We recommend including the following values in the request body for your reference:
  • {{1.result}}: This is the full event payload received from Shopify. You will see an example of the event in your workflow Test Data. See Shopify’s documentation on event payloads for more details.
  • {{userSettings.userId}}: This is the User ID of the Connected User that received the event. You can use this ID to relate the event to a user in your application.
Finally, configure your 3 workflows to be hidden from the Connect Portal and enabled by default:
  • Click the context menu in the Workflow Editor toolbar and click Edit Connect Portal Workflow Settings.
  • Switch on Default to enabled and Hide workflow from Portal for all users.
  • Repeat for each workflow that has a Shopify privacy event trigger.
Having both options on will mean that this workflow will run for all users of your Shopify integration, and users will not see or need to configure the workflow from your Connect Portal.

Testing and validating privacy webhooks

To test your privacy webhook implementation end-to-end:
  • Verify that your shopify.app.toml compliance subscriptions have been deployed with shopify app deploy.
  • Verify that each of your workflows are deployed.
  • In your application, connect a Shopify store to the Connect Portal. Remember the store and account that you have connected.
  • In the Shopify Admin page for the same store, request or erase a customer’s data (see Shopify documentation). These actions will trigger the “Customer data request” and “Customer data erasure” events, respectively.
  • In the Paragon dashboard, visit the Monitoring > Workflows page and verify that your workflow has executed.