# Shopify

> Source: https://truto.one/docs/integration-guides/shopify/

Connect a Shopify store to Truto with OAuth 2.0 through a Shopify app you own.

## Install the Shopify integration

Install Shopify from [Available integrations](https://app.truto.one/integrations/available/588fe815-8967-4d4d-a69e-2d2613d1c6e4) in each environment you connect accounts from.

## Create a Shopify OAuth app

Truto doesn't ship a Shopify OAuth app of its own, so bring yours. Until you set its Client ID and Client Secret on the installed integration, the Connect UI doesn't list Shopify. See [Until the app is configured](/docs/guides/integrations/overriding-oauth-credentials#until-the-app-is-configured). When you click **Install**, the second step shows the Redirect URL to add to your app and asks for its Client ID and Client Secret. If you skip it, add them later on the **Configuration** tab.

1. In Shopify's [Dev Dashboard](https://shopify.dev/docs/apps/build/dev-dashboard/create-apps-using-dev-dashboard), open **Apps** and click **Create app**. Choose **Start from Dev Dashboard**, enter a name and click **Create**.
   Choose a distribution method: **Public** to connect stores you don't own (the app can stay unlisted), or **Custom** for one store or the stores of one Shopify Plus organization. You can't change it later.
2. On the app's **Versions** page, create a version:
   - Under **Scopes**, add the scopes listed below. If you override the scopes on the Truto integration, add those instead.
   - Under **Redirect URLs**, add the redirect URL below.
   - Click **Release**. Shopify applies redirect URLs only once they are part of a released version.
3. Open **App settings**. The **Credentials** card shows the **Client ID** and **Client secret**. Enter them on the installed Shopify integration; see [Overriding OAuth credentials](/docs/guides/integrations/overriding-oauth-credentials#steps-to-overriding-oauth).
4. With public distribution, request access to protected customer data: in the Dev Dashboard, open your app → **Settings** → **Access requests**, and click **Manage** next to **Protected customer data**. Shopify reviews the request before the app can read orders and customers on merchants' stores. Custom-distribution apps have this access without a review.

Redirect URL:

```text
https://api.truto.one/connect/shopify/callback
```

If you [use a redirect URL on your own domain](/docs/guides/integrations/overriding-oauth-credentials#use-a-redirect-url-on-your-own-domain), register that URL instead.

By default, Truto asks Shopify for these scopes. The Connect UI lists them under **Permissions required**, and you can change them when you override the OAuth credentials.

- `read_orders`
- `read_customers`
- `read_products`
- `read_users`

`read_users` needs Shopify's approval and works only on stores on the Shopify Plus or Advanced plan. Remove it from the scopes unless you need staff accounts.

## Find the store's subdomain

1. Sign in to the Shopify admin of the store.
2. Click **Settings** in the bottom-left corner.
   ![Click Settings](https://docs-assets.truto.one/shopify-details-1.png)
3. Open **Store details**. The store's `myshopify.com` address is listed there.
   ![Store details](https://docs-assets.truto.one/shopify-details-2.png)

## Connect a Shopify account

1. In [Integrated Accounts](https://app.truto.one/integrated-accounts), click **Connect Account**.
   ![Click Connect Account](https://docs-assets.truto.one/truto-connect-account.png)
2. Enter a **Tenant ID** (your customer's ID; Truto creates the tenant if it is new), or pick one under **Existing tenant (optional)**. Check the **Environment** and the **Region** (where Truto places the account; Western North America by default). To open the link straight on Shopify, pick it under **Advanced settings** → **Integration (optional)**. Click **Get connection link**.
   ![Get connection link](https://docs-assets.truto.one/truto-connect-account-modal.png)
3. Click the open-in-new-tab button, or click **Copy** and send the link to your customer so they connect their own Shopify account. The link works for 7 days, until an account is connected with it.
   ![Share connection link](https://docs-assets.truto.one/truto-connect-account-link.png)
4. Click **Get Started** if it shows, then select **Shopify**.
5. Fill in the form and click **Connect**:

   | Field | Required | What to enter |
   |---|---|---|
   | **Shop** | Yes | The store's subdomain: for `acme.myshopify.com`, enter `acme`. See [Find the store's subdomain](#find-the-stores-subdomain). |
6. Sign in to Shopify and allow access.
7. Close the tab when you see **Connection successful**. The new account appears under **Integrated Accounts**. Click its Account ID to see its details and make API calls.
