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

# Shopify

> Connect a Shopify store to IrisAgent and add your existing chatbot to the storefront

## Overview

The Shopify integration connects a Shopify store to an IrisAgent account and records which existing chatbot is associated with that store. In the initial release, you install the chatbot on the storefront by copying its JavaScript embed code into the Shopify theme.

The integration supports:

* Connecting one Shopify store to an IrisAgent account
* Associating an existing IrisAgent chatbot with the Shopify connection
* Viewing the connected store and granted Shopify permissions
* Changing the associated chatbot or disconnecting the store later
* Answering live product, pricing, and inventory questions
* Looking up order status and shipment tracking after matching an order number and email address

<Note>
  Product and order information is read live from Shopify and is not synchronized into the IrisAgent knowledge base. Refunds, cancellations, returns, and other write actions are not included.
</Note>

## Before you begin

You need:

* IrisAgent administrator access
* Shopify administrator access for the store
* At least one chatbot configured in IrisAgent
* The permanent `*.myshopify.com` domain for the store

During the private rollout, the Shopify app can be installed only on approved development or test stores. Installation by unrelated merchants will become available after the app is approved for public Shopify distribution.

## Connect Shopify

1. Log in to the [IrisAgent dashboard](https://web.irisagent.com/).
2. In the left navigation, open **Data Sources → E-commerce**.
3. Select the **Shopify** card.
4. Enter the permanent Shopify domain, such as `your-store.myshopify.com`.
5. Choose the IrisAgent chatbot to show on the store.
6. Click **Connect Shopify**.
7. Review and approve the requested permissions in Shopify.

After authorization, Shopify returns you to IrisAgent and the connection status shows the store name and granted permissions.

<Note>
  Stores connected before read-only order lookup was introduced must click **Reconnect Shopify** and approve the `read_orders` permission. Without that permission, product search remains available but order status and shipment tracking are disabled.
</Note>

## Configure commerce capabilities

After connecting the store, use **Read-only commerce capabilities** on the Shopify configuration page to enable or disable:

* **Product search, pricing, and inventory availability**
* **Order status and shipment tracking**

These capabilities apply only to the chatbot selected under **Chatbot shown on this store**.

For product questions, the chatbot searches current Shopify product data and returns up to five matching products. For order questions, the chatbot collects both the order number and the email used on the order. IrisAgent returns order details only when both values match the same Shopify order.

Shopify's standard `read_orders` permission covers orders from the most recent 60 days. Access to older orders requires Shopify's separately approved `read_all_orders` permission, which this integration does not request by default.

## Add the chatbot to the storefront

Connecting Shopify does not publish the chatbot. Install it using the embed code available from the chatbot configuration in IrisAgent.

1. In IrisAgent, open **Manage Chatbot → Configurations**.
2. Open the chatbot configuration that you want to install.
3. Click **Get Code**.
4. Click **Reveal API Key**, then copy the complete embed-code snippet.
5. In Shopify Admin, open **Online Store → Themes**.
6. For the published theme, click the **…** menu and select **Edit code**.
7. Under **Layout**, open `theme.liquid`.
8. Paste the copied IrisAgent snippet immediately before the closing `</body>` tag.
9. Click **Save**.
10. Open the storefront and confirm that the IrisAgent chat widget appears.

<Warning>
  Add the snippet only once and only to themes where the chatbot should appear. Manual theme-code changes might need to be reapplied when you replace or update a theme.
</Warning>

The snippet loads the same chatbot widget used on other websites. Its token identifies the chatbot configuration, while its appearance and behavior continue to come from IrisAgent.

## Change the chatbot

To use a different chatbot on the connected store:

1. Open **Data Sources → E-commerce → Shopify** in IrisAgent.
2. Select another option under **Chatbot shown on this store**.
3. Open that chatbot under **Manage Chatbot → Configurations** and copy its code using **Get Code**.
4. In the published Shopify theme's `layout/theme.liquid` file, replace the previous IrisAgent snippet with the new snippet and click **Save**.

Changing the selection on the Shopify configuration page does not update a manually installed snippet. The storefront changes chatbots only after its embed code is replaced. Only IrisAgent administrators can change the Shopify association.

## Disconnect Shopify

1. Open **Data Sources → E-commerce → Shopify**.
2. Click **Disconnect** and confirm the action.

Disconnecting revokes the Shopify access token and removes the store association from IrisAgent. Because the initial release installs the widget manually, disconnecting Shopify does not remove its JavaScript from the theme or stop the widget by itself. To remove the chatbot from the storefront, also delete the IrisAgent `<script>` snippet from `layout/theme.liquid` and save the theme.

## Troubleshooting

### The chatbot does not appear

* Confirm that the complete IrisAgent `<script>` snippet appears immediately before `</body>` in `layout/theme.liquid`.
* Confirm that you edited and saved the published theme.
* Confirm that the snippet contains the token revealed for the intended chatbot configuration.
* Make sure the snippet was added only once.
* Test the published storefront in a new browser tab.

### The Connect Shopify button is disabled

* Confirm that you are an IrisAgent administrator.
* Enter the permanent `*.myshopify.com` domain, not a custom storefront domain.
* Select a chatbot.
* If the page says Shopify is not configured for the environment, contact IrisAgent support.

### Shopify reports that the store is already connected

A Shopify store can belong to only one IrisAgent account. Disconnect it from the original IrisAgent account or contact IrisAgent support before connecting it elsewhere.

## Permissions and customer data

The integration requests the Shopify permissions displayed during installation. IrisAgent stores the shop connection, capability settings, and encrypted Shopify access token. Product and order information is requested from Shopify only when the chatbot needs it. IrisAgent does not synchronize or persist Shopify customer profiles or order history.
