> For the complete documentation index, see [llms.txt](https://integrations.drivetrain.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://integrations.drivetrain.ai/integration-guide/readme/others/integrating-with-shopify.md).

# Integrating with Shopify

Sync Shopify store data with Drivetrain to incorporate e-commerce revenue into models. Covers custom app creation, API key setup, and authorization steps.

[Prerequisites](#prerequisites)\
[Shopify setup](#shopify-setup)\
[Step 1: Create a private app](#step-1-create-a-private-app)

## Prerequisites

1. An active Shopify account.
2. Admin privileges in Shopify.

## Shopify setup <a href="#shopify-setup" id="shopify-setup"></a>

Drivetrain connects to Shopify using a private app API key created in Shopify for this integration. To set up this integration, log in with an admin account, create a private app, assign the relevant permissions to access your Shopify objects, and share the API credentials with us. This guide covers each of these steps in detail below.

### Step 1: Create a private app

1. Log in to your Shopify account and click **Settings ⚙** (bottom left).
2. Click **Apps and sales channels**, then click **Develop apps**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-5db652d937c02b91e9d13498f87457d1f34ec153%2Fshopify-01.png?alt=media)

3. Click **Allow custom app development** in the next two screens.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-ace8f740af6557fd1fd74fc3cf2256edeb03a4b1%2Fshopify-steps-drivetrain.png?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-52a2c6b9c7138e4c56721c62e7100b77fa851f2e%2Fshopify-03.png?alt=media)

4. Click **Create an app**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-88c96628e18e880e006883f6119be61031a35eee%2Fshopify-04.png?alt=media)

5. Enter the app name **Drivetrain Integration** and click **Create app**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-da32584537890ca48a2cf0f526307b2e2acdfba1%2Fshopify-05.png?alt=media)

6. Click **Configure Admin API scopes** and select the scopes you want to pull into Drivetrain. Enable **Read** access for every scope you select, and click **Save**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-b2e7ac42a83bcfedcb6fac74ad7dc27d0a9a75a6%2Fshopify-06.png?alt=media)

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-0911b5f34e24c803b337d539d48933e064c7d2f4%2Fshopify-steps-2.avif?alt=media)

7. After adding the necessary scopes for your integration, click **Install App**.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-210571594f5da837693642ad70523e87b899cad1%2Fshopify-08.png?alt=media)

8. Click **Reveal Token Once** and store the **Admin API Access Token** in a secure document.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-34e30d7f7538e0c0b8074c86d8d44bc845cb8d35%2Fshopify-09.png?alt=media)

{% hint style="info" %}
You won’t be able to access the Admin API Access Token again, so store it in a document when you copy it.
{% endhint %}

9. Copy the API key and secret key into the same secure document.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-56c0a097387a621be6dd163436ac2f30eff4876e%2Fshopify-10.png?alt=media)

10. Copy the store URL into the same secure document.

![](https://4220329029-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmBZR0D9lq6jrI895OuOU%2Fuploads%2Fgit-blob-13e1df2c9f1674b761ecfda74117b94e96e260c0%2Fshopify-11.png?alt=media)

{% hint style="info" %}
That's it! Share the following information with your customer success manager or solutions consultant so that they can get started:

* API key
* API Secret Key
* API Access Token
* Store URL
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://integrations.drivetrain.ai/integration-guide/readme/others/integrating-with-shopify.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
