> For the complete documentation index, see [llms.txt](https://docs.churned.io/churned-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.churned.io/churned-docs/integrations/billing-and-commerce/shopify.md).

# Shopify

Connect your Shopify store to Churned with a Dev Dashboard app and its client credentials.

Churned integrates with Shopify to sync customer data, orders and product interactions for better churn prediction and lifecycle automation.

{% hint style="info" %}
Shopify no longer lets you create new custom apps in the store admin under **Settings > Apps > Develop apps** with an API key and password. New apps are built in the **Shopify Dev Dashboard**, and Churned connects with the app's **Client ID** and **Client secret**. You don't need a redirect URL, an authorization code or a long-lived access token: Churned requests and refreshes Shopify's 24-hour access tokens for you, server-side.
{% endhint %}

## What you need

* Access to the Shopify organization that owns the store, with permission to create apps in the Dev Dashboard
* Permission to install apps on the store
* Your store URL, for example `acme.myshopify.com` or `admin.shopify.com/store/acme`

## Step 1: Open the Dev Dashboard

In your Shopify admin, go to **Settings > Apps > App development** and click **Build apps in Dev Dashboard**. You can also go straight to [dev.shopify.com/dashboard](https://dev.shopify.com/dashboard). Make sure you're in the **organization that owns the store**.

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2FBptTkJ3CIgx3AKH3GCPn%2F01-admin-app-development.png?alt=media&amp;token=10e19331-472c-478e-9701-45125a08c4ed" alt="App development page in Shopify admin with the Build apps in Dev Dashboard button"><figcaption><p>Settings > Apps > App development in the Shopify admin</p></figcaption></figure>

On the Dev Dashboard home, click **Create an app**.

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2FYXDT5giOW45YRrHBgPyx%2F02-dev-dashboard-home.png?alt=media&amp;token=a6ad29e9-e5ed-4784-bfa1-05d55a64a3e6" alt="Shopify Dev Dashboard home with Create an app"><figcaption><p>Dev Dashboard home</p></figcaption></figure>

## Step 2: Create the app with the right scopes

Fill in the **Create an app** form:

* **App name**: for example `Churned`
* **Scopes** (under **API access**): `read_customers,write_customers`

Leave the other fields (App URL, redirect URLs, webhooks version) as they are; Churned doesn't use them. Click **Create app**.

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2FvSLPPLGjitVQWinI6JIi%2F03-create-app-form.png?alt=media&amp;token=9411dd62-53b6-4b9d-89d0-63b9e375f27a" alt="Create an app form with app name Churned and scopes read_customers,write_customers"><figcaption><p>Create an app: name and Admin API scopes</p></figcaption></figure>

## Step 3: Release the version

Shopify asks you to release the first version of the app. Click **Release**.

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2FfTpVatxrNZudJWEc5XSK%2F04-release-version.png?alt=media&amp;token=184c19f1-608d-4003-a90e-c717c28ae1fa" alt="Release version dialog"><figcaption><p>Release the first version</p></figcaption></figure>

Under **Versions** the new version now shows as **Active**.

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2FhRrxiPGuME1shWR5te79%2F05-version-active.png?alt=media&amp;token=b1da2f60-ac49-4c09-91af-4617a4dd8e6b" alt="Versions list with the first version marked Active"><figcaption><p>The released version is Active</p></figcaption></figure>

{% hint style="info" %}
Need to change the scopes later? Create a **new version** with the updated scopes and release it. The store owner may need to approve the new access.
{% endhint %}

## Step 4: Install the app on your store

Open the app's **Overview** and click **Install app**. Pick your store, review the requested access and click **Install**.

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2FggLOpfveLszk9Wdvo5LT%2F06-overview-install-credentials.png?alt=media&amp;token=cea548e5-5a90-4ceb-91e7-f99b3951fce0" alt="App overview with the Install app button and the Credentials card"><figcaption><p>App overview: Install app and Credentials</p></figcaption></figure>

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2FsvzAKCu6OaJBZGGk2wfN%2F07-install-app.png?alt=media&amp;token=ac5a3f42-9900-4146-9bb3-114a55d54eb9" alt="Install app screen in the Shopify admin listing the requested customer access"><figcaption><p>Approve the install on your store</p></figcaption></figure>

After installing, Shopify opens the app inside your admin and shows a placeholder page (the default `example.com` App URL). That's expected. Churned doesn't use the embedded app page.

## Step 5: Copy the Client ID and Client secret

In the Dev Dashboard, open the app's **App settings** (the **Credentials** card is also on the Overview page) and copy:

* **Client ID**
* **Client secret**: click the eye icon to reveal it, or use the copy button

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2F4iXyxeOBIANfT3MKRcX9%2F08-app-settings-credentials.png?alt=media&amp;token=ed858bef-358b-4cbc-bef2-7711b589735b" alt="App settings page with the Credentials card showing Client ID and Client secret"><figcaption><p>App settings > Credentials</p></figcaption></figure>

{% hint style="warning" %}
Treat the client secret like a password. Only paste it into Churned. If it leaks, click **Rotate** and update the new secret in Churned.
{% endhint %}

## Step 6: Add the integration in Churned

1. In Churned, go to **Integrations** and select **Shopify**.
2. Fill in:
   * **Client ID**: from the app's settings
   * **Client Secret**: from the app's settings
   * **Store Url**: for example `acme.myshopify.com` or `admin.shopify.com/store/acme`
3. Click **Save**. Churned tests the connection and the status changes from **Not Activated** to **Activated**.

<figure><img src="https://246234927-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FkSyCQUyE0u7ya9ULaprd%2Fuploads%2FCJhCeLxgSs832PxLHwum%2F09-churned-shopify-form.png?alt=media&amp;token=c287b41e-e789-429e-9893-5818292a6259" alt="Shopify connection form in Churned with Client ID, Client Secret and Store Url"><figcaption><p>The Shopify integration form in Churned</p></figcaption></figure>

Then let the Churned team know so they can start syncing your data.

## Troubleshooting

* **Connection fails after Save**: check that the app version with the scopes is **released** and that the app is **installed on the same store** you entered as Store Url.
* **Wrong organization**: the app must be created in the organization that owns the store, otherwise the client credentials can't get a token for that store.
* **Secret rotated**: if you rotate the client secret in the Dev Dashboard, update it in Churned.
* **Can't find Develop apps**: that's expected. Shopify replaced legacy custom apps with the Dev Dashboard, so follow the steps above.

## Helpful links

* [Shopify Dev Dashboard](https://dev.shopify.com/dashboard)
* [Shopify docs: client credentials grant](https://shopify.dev/docs/apps/build/authentication-authorization/access-tokens/client-credentials-grant)
* [Shopify Admin API](https://shopify.dev/docs/api/admin-graphql)
