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

# How to connect

> How to connect the Shopify data source to Adriel: create a Shopify app, retrieve the Client ID and Secret, install the app, then enter the shop name and credentials in Adriel.

Shopify is a direct-to-consumer commerce platform that powers merchant storefronts worldwide. Connecting it reads order and product data from a Shopify store through the Admin GraphQL Bulk Operations API, bringing orders, revenue, discounts, taxes, shipping, returns, and product-level performance into Adriel dashboards alongside ad-platform spend.

## Before you connect

The following are required:

* A Shopify store with admin access.
* The Shopify **shop name** — the `xyz` in `xyz.myshopify.com`.
* Permission to install a custom app on the store.

## Connect Shopify

Setting up Shopify has two parts: first create a Shopify app and retrieve its Client ID and Secret, then enter those credentials in Adriel.

<Steps>
  <Step title="Create an app and retrieve the Client ID and Secret">
    Sign in to the Shopify account to connect, then open the [Shopify Developer Dashboard](https://partners.shopify.com/) (or sign in through the Shopify Admin and click **Build apps in Dev Dashboard**). Partner status is typically required to access the dev dashboard; if it is unavailable, follow the [Shopify app build guide](https://shopify.dev/docs/apps/build/build).

    On the **Apps** tab, click **Create app** in the upper right, enter an app name, and click **Create**.
  </Step>

  <Step title="Configure scopes, redirect URL, and app URL">
    Enter the settings below, then click **Release**:

    * **Scopes**: select `read_customers`, `read_inventory`, `read_orders`, and `read_products`.
    * **Redirect URLs**: `https://api.adriel.com/api/link/shopify/callback`
    * **App URL**: `https://app.adriel.com`
    * Disable **Embed app in Shopify admin**.

    After releasing, open the app's **Settings** tab and copy the **Client ID** and **Client Secret**. Save both for the next steps.
  </Step>

  <Step title="Install the app on the store">
    On the overview page of the created app, click **Install app** in the top right and install it on the store(s) to connect.
  </Step>

  <Step title="Enter the shop name and credentials in Adriel">
    On the **Data Sources** page, search for **Shopify** and select it. Fill in the three required fields:

    * **Shop name**: the last part of the admin URL. For example, in `https://admin.shopify.com/store/test-store-adriel/` the shop name is `test-store-adriel`. Enter only the shop name, not the full URL.
    * **Client ID**: the Client ID copied earlier.
    * **Client Secret**: the Client Secret copied earlier.

    Optionally set a **Name** — any distinguishable label for the data source as it appears on the dashboard.
  </Step>

  <Step title="Submit">
    Click **Submit** to complete the connection. Initial data availability can take up to one business day.
  </Step>
</Steps>

## What gets imported

The connector imports the product catalog and order history for the connected store — orders, revenue, discounts, taxes, shipping, returns, payment methods, order source, and product-level performance, including cost of goods sold when inventory unit cost is configured. Up to 90 days of historical orders are available at first connection, with incremental updates after that.

For the complete list of metrics, breakdowns, and refresh behavior, see the [Shopify data reference](/data-sources/o-z/shopify/data-reference).

## Troubleshooting

<AccordionGroup>
  <Accordion title="Sync stops with an app access revoked error">
    Shopify's offline access tokens stay valid until the app is uninstalled from the store admin or access is revoked. If either has happened, reconnect the data source to reauthorize.
  </Accordion>

  <Accordion title="Cost metrics are empty">
    Product Cost and Order Products Cost Amount are populated from the inventory unit cost set on each product in Shopify. Products without a unit cost contribute no value to cost metrics. Set unit costs in the Shopify admin to backfill these fields on subsequent refreshes.
  </Accordion>

  <Accordion title="Net Sales does not match Shopify analytics exactly">
    Net Sales, Gross Sales, Total Sales, Tax, Shipping, Net Returns, and Net Discount are reconstructed to mirror Shopify's native analytics: Net Sales = Gross Sales − Discounts − Returns, and Total Sales = Net Sales + Tax + Shipping. Small differences can appear when Shopify's dashboard applies filters or date windows that differ from the reporting view.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Shopify data reference" href="/data-sources/o-z/shopify/data-reference">
    Metrics, breakdowns, and refresh behavior for Shopify.
  </Card>

  <Card title="Shopify FAQs" href="/data-sources/o-z/shopify/faqs">
    Common questions and expected behaviors for the Shopify data source.
  </Card>

  <Card title="How to connect WooCommerce" href="/data-sources/o-z/woocommerce/how-to-connect">
    Connect an alternative direct-to-consumer commerce platform.
  </Card>
</CardGroup>
