> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hotglue.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopify

# Connector Details

| Name           | Value                                                                                        |
| :------------- | :------------------------------------------------------------------------------------------- |
| Platform       | [Shopify](https://shopify.com)                                                               |
| Auth Type      | API Keys                                                                                     |
| Direction      | Bidirectional                                                                                |
| Triggers       | <Tooltip tip="4 triggers available by default">Supported</Tooltip>                           |
| Tap Repo       | [https://github.com/hotgluexyz/tap-shopify](https://github.com/hotgluexyz/tap-shopify)       |
| Target Repo    | [https://gitlab.com/hotglue/target-shopify-v2](https://gitlab.com/hotglue/target-shopify-v2) |
| Tap Metrics    | <p>  Usage: </p>                                                                             |
| Target Metrics | <p>  Usage: </p>                                                                             |
| Unified Schema | [Supported in Ecommerce Unified Schema.](https://hotglue.com/docs/unified)                   |

# Credentials Setup

Follow the steps below to get the credentials you need to use the Shopify connector.

There are two ways to use Shopify: either via a Shopify Public App (OAuth) or using a Private App (API keys). hotglue environments will default to private apps, but you can use either. Below are guides to setting up both:

## Public App (OAuth)

<Info>
  When using Public App (OAuth), make sure to use the Shopify OAuth connector in hotglue instead of the API Key based version.
</Info>

### 1. Register a Shopify Public App

To start, you will need to create a Shopify developer account at [shopify.dev](https://shopify.dev/).

After entering some basic information, you'll be taken to an overview page. There's a tab that says "Build apps for clients or the Shopify App Store." When you click it, you'll see a button to create an app. Click that too.

Once you name your app, you'll get the Client ID and Client Secret that you need for hotglue. Add a logo and preferences URL while you're at it.

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/ShopifyPublicApp.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=e830779f864072d538c056965854b46c" alt="Shopify Public App" width="3024" height="1546" data-path="connectors/images/ShopifyPublicApp.png" />

### 2. App Setup

There are two distinct ways to have hotglue manage your Shopify App. See the video walkthrough below explaining each option:

<iframe width="100%" height="480" src="https://www.loom.com/embed/2a670c7b3fe942c6bf15a9e78ffe1e0f" title="hotglue – Shopify OAuth apps" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen className="w-full aspect-video" />

In both scenarios, you must:

1. Add hotglue to the "Allowed redirection URL." This should be set to `https://hotglue.xyz/callback` <img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/ShopifyRedirectUri.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=1a4992d05cfd974c146a9d8cf31327a2" alt="Shopify Redirect URL" width="3020" height="1534" data-path="connectors/images/ShopifyRedirectUri.png" />
2. Configure a URL to redirect to once the authorization process is complete (`complete_url`). This is done in the JSON definition under Settings -> Connectors -> Sources -> Shopify OAuth. (Or, if using bi-directional flows, via Settings -> Connectors -> Shopify OAuth)

```json theme={null}
{
  "tap": "shopify:oauth",
  "version": "oauth",
  "isForked": true,
  "label": "Shopify",
  "icon": "https://s3.amazonaws.com/cdn.hotglue.xyz/images/logos/shopify.svg",
  "domain": "shopify.com",
  // NOTE: You can also customize this list of scopes
  "tap_url": "https://{shop}.myshopify.com/admin/oauth/authorize?scope=read_customers,read_inventory,read_orders,read_products",
  // NOTE: This is the URL the tenant will be sent to once they complete the OAuth process
  "complete_url": "https://app.acme.com/"
}
```

#### 2a. Fully Managed

With this method, hotglue will handle generating the tenant ID + creating the config. To use this method, simply set your app URL to

```
https://api.hotglue.com/shopify/{env_id}/{flow_id}
```

#### 2b. Semi Managed

Set a custom app URL (to your webapp for example), and then "forward" the request to hotglue. With this method you can supply the desired `tenant` id in the query params.

Here's a simplified example using Express to illustrate how the semi-managed flow works:

```javascript theme={null}
app.get('/app', async (req, res, next) => {
    // Get the query params
    const { shop } = req.query;

    // TODO: write some logic to decide what the tenant id should be
    const tenantId = "magic-ruffalo-123";

    // Redirect the tenant to complete the Shopify OAuth process (notice we are forwarding the shop and tenant query params)
    const url = `${HG_API_URL}/shopify/${HG_ENV_ID}/${HG_FLOW_ID}?shop=${shop}&tenant=${tenantId}`
    console.log("Redirecting to: ", url);

    res.redirect(302, url);
});
```

### 3. API Access

Depending on your use case, you may need to request permissions for access to certain scopes.

Most use cases will require the "Read all orders" scope, which you can request on this page. If it's relevant to your app, it isn't too hard to get this access. You may also be interested in requesting subscription APIs and protected customer data.

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/ShopifyAPIAccess.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=928bf657677c14bd62ef684befb8feab" alt="Shopify API Access" width="3020" height="1714" data-path="connectors/images/ShopifyAPIAccess.png" />

### 4. Distribution

Once you finish configuring your app and confirming that it works for your own account, you can begin the app registration process.

You will want to make your app publicly available, so this can't be a Single Merchant Install. There is a one-time \$99 fee associated with registering to be on the Shopify app store.

<img src="https://mintcdn.com/hotglue/5Ve6qyQIr-eWU9BP/connectors/images/ShopifyDistribution.png?fit=max&auto=format&n=5Ve6qyQIr-eWU9BP&q=85&s=e6b5955e9232ba5d7a9c29358eaf6767" alt="Shopify Distribution" width="3014" height="1590" data-path="connectors/images/ShopifyDistribution.png" />

## Custom Apps (OAuth)

If you are creating a one-off connection to one shop or a small number of shops, you can create an OAuth Custom App.

The benefits of this approach are that:

* You do not need to worry about unknown merchants installing your application.
* You can avoid the drawn-out approval process that comes with public apps.

The drawbacks are that:

* Shopify does not allow you to use this approach as a full "workaround" for obtaining a public app. If you are connecting many tenants, Shopify expects you to build a public app.
* You will need to manually generate the app for each user, then send the installation links to customers individually.

### Setup

The process to create a custom app is very similar to creating a public app. All of the steps for Custom Apps are the same as those listed above for public apps, with the exceptions of:

* `3a` / `3b` -> Instead of opting for Semi-Managed, you should always stick to Fully managed. Since you are creating the app for a specific customer, you can just add the tenant ID to your `App URL` that you configure in Shopify. This will look like the below:

```
https://api.hotglue.com/shopify/{env_id}/{flow_id}?tenant=<YOUR_TENANT_ID>
```

* `Distribution` -> Instead of creating a public app, you will create your app for a specific store. You will need to obtain the shop URL from your customer. Once you assign the app to that specific store, you will obtain an authorization link, which much be manually shared with the customer.

With those two changes, the customer will click on the installation link and go through authorization like normal. The tenant will be linked in hotglue, with an access token, once they successfully complete the authorization workflow.

## Custom Apps (Client Credentials)

<Info>
  Custom Apps are limited to a single store, which means these steps need to be performed for **each of your customers**.
</Info>

### Register the app

The first thing you need to do is log in to [Shopify](https://shopify.com). If you're just testing you can create a free partner account.

Once logged in, on the left side of the screen, select the Apps option in the navigation bar. From there, select "Build apps in Dev Dashboard"

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyDevDashboard.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=19e623434dd785363639bce5304a1688" alt="" width="3022" height="1204" data-path="connectors/images/ShopifyDevDashboard.png" />

Once you're in the Shopify Dev Dashboard, create an app.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyCreateApp.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=8308262c4a2dc9bae4d09c9bf47421c1" alt="" width="3022" height="932" data-path="connectors/images/ShopifyCreateApp.png" />

We will create the app directly in the dashboard – give your app a name.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyAppName.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=278e2334c0c41ba3e23d390f30f112ab" alt="" width="2466" height="672" data-path="connectors/images/ShopifyAppName.png" />

### Configure distribution

Now we will set the app distribution settings. The easiest way to do this is to scroll down to the Access section, and click "Request access". This will redirect you to the Shopify Partner dashboard.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyRequestAccess.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=23383811564a727db3140d0af9141bcd" alt="" width="1594" height="688" data-path="connectors/images/ShopifyRequestAccess.png" />

Select Distribution in the left side nav. Choose Custom distribution and "Select" to continue.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyCustomDistribution.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=adc573c847b94bfac896922835009810" alt="" width="3022" height="1168" data-path="connectors/images/ShopifyCustomDistribution.png" />

This restricts your app to a single store. Input your store domain as requested. Click Generate Link.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyGenLink.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=31e5eb0f71d2891b9ed68453ae24ecd6" alt="" width="1458" height="776" data-path="connectors/images/ShopifyGenLink.png" />

You can now use the resulting link to install the app. We will do this after we select permissions. For now, just note it.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyLinkInstall.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=dd7f158da25c3af997dd5b9f4a773885" alt="" width="1478" height="912" data-path="connectors/images/ShopifyLinkInstall.png" />

### Configure permissions

Now you need to enable permissions. Head back to the Shopify Dev Dashboard and scroll down to the Access section, and click "Select scopes"

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyAppScopes.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=fbfc131c53a8de28bc549db8d2c1ec47" alt="" width="3006" height="1192" data-path="connectors/images/ShopifyAppScopes.png" />

From the resulting menu, select the relevant scopes.

<Info>
  If you plan to both read and write data with Shopify, make sure to enable **Read and write** access. Otherwise, **Read** access is sufficient.
</Info>

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifySelectScopes.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=14ff867768101049991dc9d321c44a30" alt="" width="1588" height="1286" data-path="connectors/images/ShopifySelectScopes.png" />

Once you select the relevant scopes, click Done. You should see the selected scopes listed in the Access section.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyFinalScopes.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=b047e873327bc9c370ac7d156f78b944" alt="" width="1540" height="586" data-path="connectors/images/ShopifyFinalScopes.png" />

### Release

We will now click Release to save our first version of the app.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyRelease.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=38392b0ab674b0e37362342ff894dc2f" alt="" width="3000" height="1532" data-path="connectors/images/ShopifyRelease.png" />

You can leave the version name blank and confirm by clicking Release.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyConfirmRelease.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=711e083db3ee76ed2a5ba21bd1560a76" alt="" width="1602" height="772" data-path="connectors/images/ShopifyConfirmRelease.png" />

### Install the app

There are two ways to install this app. You can use the link we generated earlier, or directly in the Shopify Dev Dashboard you can click Home -> Install -> Select the store.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyInstallApp.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=2c1d2c856146abf2cf50a1a48d86fa05" alt="" width="3016" height="1316" data-path="connectors/images/ShopifyInstallApp.png" />

Once you go through this flow, the user will be prompted to grant the requested permissions:

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyInstallConfirm.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=e4add35bf896671d2eea6d3a6f9e0d68" alt="" width="3020" height="1300" data-path="connectors/images/ShopifyInstallConfirm.png" />

### Get credentials

Now that the app is installed on the store, you can use the **Client Id** and **Client Secret** pair in Hotglue!

To view the **Client Id** and **Client Secret** of our new app click on Settings in the left side nav.

<img src="https://mintcdn.com/hotglue/HqxcKJnhGIPfz7dY/connectors/images/ShopifyClientCreds.png?fit=max&auto=format&n=HqxcKJnhGIPfz7dY&q=85&s=ab428fda446a4035a010006f2cf516d4" alt="" width="3010" height="1034" data-path="connectors/images/ShopifyClientCreds.png" />

# Tap Changelog

<Accordion title="Tap Changelog">
  | Version                                                                                                 | Notes                                                                              |
  | :------------------------------------------------------------------------------------------------------ | :--------------------------------------------------------------------------------- |
  | [v1.4.13](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.13)                               |                                                                                    |
  | [v1.4.12](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.12)                               |                                                                                    |
  |                                                                                                         |                                                                                    |
  | [v1.4.10](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.10)                               |                                                                                    |
  | [v1.4.9](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.9)                                 |                                                                                    |
  | [v1.4.8](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.8)                                 |                                                                                    |
  | [v1.4.7](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.7)                                 |                                                                                    |
  | [v1.4.6](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.6)                                 |                                                                                    |
  | [v1.4.5](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.5)                                 | - Update retry logic                                                               |
  | [v1.4.4](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.4)                                 | - Add new streams<br />- Optimize tap performance                                  |
  | [v1.4.3 - Add shop stream](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.3)               | - Added `shop` stream                                                              |
  | [v1.4.2 - Add support for incoming](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.2)      | Added support for `incoming` orders                                                |
  | [v1.4.1 - Add support for access\_token](https://github.com/hotgluexyz/tap-shopify/releases/tag/v1.4.1) | Added support to use the key `access_token` in the config in addition to `api_key` |
</Accordion>
