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

# Add an AI agent to your Shopify store

> Connect your Shopify store so your AI agent can help customers browse, buy, track orders, and manage their account

The Chatbase Shopify integration connects your Shopify store to a Chatbase AI agent, so the AI agent can answer shoppers with your live catalog, cart, and order data. It's for Shopify merchants who want one assistant that helps shoppers before they buy (finding products, filling the cart, checking out) and after (tracking orders, returns and exchanges, account updates). Installing the Chatbase app adds the Chat Bubble to your storefront automatically, and many Shopify Actions also work on channels such as WhatsApp, Instagram, Messenger, and Phone.

> [card] What you can do:
>
> Give shoppers a single place to find a product, add it to the cart, check out, and ask where their order is, without leaving the chat.

> [!WARNING]
>
> **You do not need to add any embed code manually.** Once you install the Chatbase Shopify app, whether from Chatbase or the Shopify App Store, the Chat Bubble is automatically added to your store. You do not need to copy or paste any embed script into your theme code.

## What your AI agent can do for your store

You choose what the AI agent can do by turning on [Shopify Actions](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md).

**Before the purchase**

| Shopper asks | What the AI agent does | Action |
| - | - | - |
| "Show me red dresses under \$50" | Searches your synced catalog and shows matching products with **Add to cart** buttons. Shoppers can also send a photo to find a matching product | [Retrieve and display products](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#1-retrieve-and-display-products) |
| "Add two of these to my cart" | Adds, removes, or changes the quantity of items in the cart | [Update cart](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#2-update-cart) |
| "What's in my cart?" | Shows the items, quantities, and total | [Get cart](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#3-get-cart) |
| "I'm ready to check out" | Places the order and sends a Shopify checkout link, or places it as cash on delivery | [Create order](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#4-create-order) |

**After the purchase**

| Shopper asks | What the AI agent does | Action |
| - | - | - |
| "Where is my order?" | Looks up the order status, tracking, and purchase history from Shopify | [Retrieve and display orders](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#7-retrieve-and-display-orders) |
| "I want to return these shoes" | Opens a return on the existing order, inside the return window you set | [Create return or exchange (same order)](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#6-create-return-or-exchange-same-order) |
| "Can I swap this for a size 10?" | Creates an exchange that a person on your team approves in the Helpdesk | [Create exchange (new order)](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#5-create-exchange-new-order) |
| "I never got an activation email" | Checks whether the shopper is signed in and emails an activation link | [Check account and send activation email](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#9-check-account-and-send-activation-email) |
| "Update my email address" | Changes the signed-in shopper's name, email, phone number, or billing address | [Update customer profile](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#10-update-customer-profile), [Update customer billing address](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#11-update-customer-billing-address) |

No Shopify Action cancels an order or changes the shipping address on a placed order. Send those requests to your team with [Escalations](https://chatbase.co/docs/user-guides/chatbot/actions/escalate-to-human.md). See [Limitations](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#limitations).

### Example: from product question to order tracking

1. A shopper on your storefront opens the Chat Bubble and asks, "Do you have a waterproof jacket under \$100?" The AI agent uses **Retrieve and display products** and shows matching jackets with **Add to cart** buttons.
2. The shopper says, "Add the black one in medium." The AI agent uses **Update cart**, then asks whether they want to add more or place the order.
3. The shopper says, "Check out." The AI agent uses **Create order** and replies with a secure Shopify checkout link.
4. A few days later, the same shopper asks, "Where is my order?" The AI agent uses **Retrieve and display orders**. If the shopper is signed in, the order is found automatically. If they're a guest, the AI agent asks for their checkout email (or phone number) and order number first. Shipped orders show as **On its way**.

## Before you start

* A Chatbase account with an AI agent, set to public. If you haven't built one yet, [create a free Chatbase account](https://www.chatbase.co/auth/signup) and follow [Your first AI agent](https://chatbase.co/docs/user-guides/quick-start/your-first-agent.md).
* A Shopify store you can install apps on.

## Integration methods

You can connect your Shopify store to Chatbase in two ways:

| Feature | Via Chatbase (Recommended) | Via Shopify Marketplace |
| - | - | - |
| Billing | Through Chatbase | Through Shopify |
| 7-day free trial | Available | Not available |
| Available add-ons | Auto recharge credits, Extra AI agents, Custom Domains, Remove 'Powered By Chatbase', Extra storage | Auto recharge credits only |
| Number of AI agents | Multiple AI agents (only a single AI agent connected to the Shopify store) | Single AI agent per account |
| Setup location | Chatbase Dashboard | Shopify App Store |

> [!NOTE]
>
> We recommend connecting via Chatbase for full access to all features and add-ons.

## Method 1: Connect via Chatbase (Recommended)

This method gives you access to all Chatbase features and add-ons, and you can start a 7-day free trial.

**1. Find the Shopify integration**

1. Go to your [Chatbase dashboard](https://www.chatbase.co/dashboard/) and select the AI agent you want to connect to Shopify.
2. Open the Shopify connection flow in either of these ways. Both lead to the same store connection step below:
   * Click **Channels** from the sidebar, then click **Setup** on the **Shopify** card.
   * Or, click **Integrations** from the sidebar, then click **Connect** on the **Shopify** card.

**2. Connect your store**

1. Enter your Shopify store name, which is the subdomain of your myshopify.com URL. For example, if your store is at `mystore.myshopify.com`, enter `mystore`. You can find it in your Shopify admin under **Settings** > **Domains**.

   ![The Shopify Integration window asking for your store name before the myshopify.com domain](https://mintcdn.com/chatbase/t6rQFYPtI-Id_rjI/user-guides/integrations/images/shopify/shopify-store-name.png?fit=max\&auto=format\&n=t6rQFYPtI-Id_rjI\&q=85\&s=c6aef55b7ba5d02aa0c3c66f6223e44f)

2. Click **Submit** to start the authorization process.

3. Shopify will ask you to authorize Chatbase. Review the requested permissions and click **Install**.

4. Once authorized, you'll be redirected back to Chatbase with a confirmation message.

**3. Manage your integration**

On the Channels page, click **Manage** on the Shopify card.

![The Manage button on the Shopify card](https://mintcdn.com/chatbase/kRgbduNouxB30eyE/user-guides/integrations/images/shopify/shopify-11.png?fit=max\&auto=format\&n=kRgbduNouxB30eyE\&q=85\&s=e044fc40e54c3c2cc443b63d753fe613)

Make sure the toggle at the top right of the page is on. Then choose the theme your website is currently using, open your Shopify theme editor, and make sure the **Chatbase** app toggle is on.

![The Shopify manage page with the toggle switched on at the top right](https://mintcdn.com/chatbase/kRgbduNouxB30eyE/user-guides/integrations/images/shopify/shopify-manage-1.png?fit=max\&auto=format\&n=kRgbduNouxB30eyE\&q=85\&s=43dd4947c5e7f0b11e3ccc7eaf764a32)

![Choosing the live theme and opening the Shopify theme editor](https://mintcdn.com/chatbase/kRgbduNouxB30eyE/user-guides/integrations/images/shopify/shopify-manage-2.png?fit=max\&auto=format\&n=kRgbduNouxB30eyE\&q=85\&s=fcb7dc794ac8db52a34fd7ef6f264064)

***

## Method 2: Connect via Shopify Marketplace

Choose this method if you prefer to manage billing through Shopify. This option has limited add-ons, allows only a single AI agent, and does not include the 7-day free trial.

**1. Install the Chatbase app**

1. Go to the **Chatbase** app listing on the [Shopify App Store](https://apps.shopify.com/chatbase).
2. Click **Install**.
3. Review the permissions Chatbase requires and click **Install** to approve.

![The Shopify Install app dialog listing the permissions Chatbase needs](https://mintcdn.com/chatbase/kRgbduNouxB30eyE/user-guides/integrations/images/shopify/shopify-install-permissions.png?fit=max\&auto=format\&n=kRgbduNouxB30eyE\&q=85\&s=16770ec6840ce5933731aa831311ab6f)

**2. Complete setup**

1. After installation, you'll be redirected to the Chatbase onboarding process to finish setting up your account.
2. Follow the prompts to configure your AI agent.

**3. Manage your integration**

On the Channels page, click **Manage** on the Shopify card.

Make sure the toggle at the top right of the page is on. Then choose the theme your website is currently using, open your Shopify theme editor, and make sure the **Chatbase** app toggle is on.

> [!WARNING]
>
> Accounts created through the Shopify Marketplace are limited to a single AI agent and do not include the 7-day Chatbase free trial. For multiple AI agents, additional add-ons, or the free trial, use Method 1 instead.

> [!TIP]
>
> Open your storefront and confirm the Chat Bubble appears and your AI agent responds. If you can't see the AI agent on your website, check the toggle in either of these places:
>
> * Click **Channels** from the sidebar and open **Chat Bubble**. In the **Overview** tab, make sure the **Visibility** toggle is switched on.
> * Or, on the **Channels** page, click **Manage** on the Shopify card and make sure the toggle at the top right of the page is on.

![The Visibility toggle in the Chat Bubble Overview tab](https://mintcdn.com/chatbase/kRgbduNouxB30eyE/user-guides/integrations/images/shopify/shopify-visibility.png?fit=max\&auto=format\&n=kRgbduNouxB30eyE\&q=85\&s=3f5c37139363fc955c375ec8f020f61e)

## Setup checklist

Work through these steps in order to go from a connected store to an AI agent that's ready for shoppers:

1. **Connect your store** with [Method 1](#method-1-connect-via-chatbase-recommended) or [Method 2](#method-2-connect-via-shopify-marketplace), and confirm the Chat Bubble appears on your storefront.
2. **Train on your store policies**, not your product pages. See [What to train your AI agent on](#what-to-train-your-ai-agent-on).
3. **Create the Retrieve and display products Action and sync your catalog.** See [Sync your products](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#sync-your-products).
4. **Turn on your first Actions.** See [Which Actions to turn on first](#which-actions-to-turn-on-first).
5. **Test from your live storefront.** Cart updates don't work in the Playground, so test cart, checkout, and account flows from the Chat Bubble on your store. See [Limitations](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#limitations).
6. **Publish, then add Tests.** [Tests](https://chatbase.co/docs/user-guides/chatbot/tests.md) run against your published AI agent, not your draft. Write a test for the requests you get most, such as "a shopper who placed order #1042 five days ago and wants to know where it is", with **Retrieve and display orders** as the expected Action.

## What to train your AI agent on

Shopify Actions give the AI agent your live products, carts, and orders. [Data Sources](https://chatbase.co/docs/user-guides/chatbot/data-sources.md) give it everything else a shopper asks about: your policies and how your store works.

**Train on:**

* Shipping pages: where you ship, delivery times, and costs
* Returns and exchanges policy: the window, condition rules, and who pays return shipping
* FAQ and help center pages, size guides, care instructions, and contact details
* Answers you want worded exactly, added as [Q\&A](https://chatbase.co/docs/user-guides/chatbot/data-sources.md) sources

**Don't train on product or collection pages.** With the **Retrieve and display products** Action enabled, your catalog syncs directly from Shopify and stays up to date. Scraped product and collection pages go stale and compete with the synced data, which can lead to outdated prices or out-of-stock items in answers. If your website is a training source, exclude the `/products` and `/collections` folders. See [Sync your products](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#sync-your-products).

> [!TIP]
>
> To add your store's website as a source, add your sitemap at `/sitemap.xml` instead of crawling the whole store. This uses less of your size limit and avoids duplicate product and collection pages. See [Website](https://chatbase.co/docs/user-guides/chatbot/data-sources.md#website).

When you update a Data Source, such as your returns policy, it shows **Syncing** while it trains and **Synced** once your AI agent can use it. This usually takes a few minutes, depending on the amount of content.

## Which Actions to turn on first

Start with the Actions that answer the most common store questions, then add the ones that change orders once you've decided your rules.

1. **Product discovery and cart:** [Retrieve and display products](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#1-retrieve-and-display-products), [Update cart](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#2-update-cart), and [Get cart](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#3-get-cart).
2. **Order tracking:** [Retrieve and display orders](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#7-retrieve-and-display-orders), so "where is my order?" is answered without a ticket. It works for signed-in shoppers and for guests who verify the order.
3. **Returns and exchanges, once your rules are set:** the same-order return completes on its own inside the **Return window (days)** you set, while the new-order exchange always waits for approval in the Helpdesk. To control when either one runs, call it from a [Procedure](https://chatbase.co/docs/user-guides/chatbot/procedures/procedures-overview.md). See [Keeping high-stakes Actions on rails](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#keeping-high-stakes-actions-on-rails).
4. **Checkout:** [Create order](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#4-create-order), so shoppers can place the order in the chat. Turn on **Update cart** whenever you use **Create order** with **Use the cart**, or the cart stays empty and there's nothing to order.

> [!NOTE]
>
> Your plan sets how many Actions an AI agent can have. See the [pricing page](https://www.chatbase.co/pricing) for the limit on each plan. On Enterprise, the limit is customizable. The five Actions in steps 1, 2, and 4 cover product discovery, checkout, and order tracking.

## Limitations

* **One AI agent per store.** Even on the Chatbase method, where you can have multiple AI agents, only a single AI agent connects to the Shopify store.
* **Marketplace accounts are capped at one AI agent**, have access to auto recharge credits only, and do not include the 7-day free trial.

## Frequently asked questions

> [accordion] Do I need to add embed code to my Shopify theme?
>
> No. Installing the Chatbase Shopify app, from Chatbase or the Shopify App Store, adds the Chat Bubble to your store automatically. If you don't see it, check that the toggle on the Shopify **Manage** page is on and that the **Chatbase** app toggle is on in your Shopify theme editor.

> [accordion] Should I train my AI agent on my product pages?
>
> No. The product sync already covers your catalog. Train on your shipping, returns, and FAQ pages instead. See [What to train your AI agent on](#what-to-train-your-ai-agent-on).

> [accordion] Can the AI agent track orders for shoppers who aren't logged in?
>
> Yes. Signed-in shoppers get their orders looked up automatically. Guests verify the order with their checkout email and order number, or their phone number and order number. If [Search by confirmation number](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#search-by-confirmation-number) is on, guests can give the order's confirmation number instead of the order number. See [Signed-in and guest customers](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#signed-in-and-guest-customers).

> [accordion] Can the AI agent cancel an order or change a shipping address?
>
> No. No Shopify Action cancels an order or changes the shipping address on a placed order. Route those requests to your team with [Escalations](https://chatbase.co/docs/user-guides/chatbot/actions/escalate-to-human.md).

> [accordion] Do Shopify Actions use more message credits?
>
> Yes. A reply that triggers an Action costs twice the model's usual message credits. See [Credit usage](https://chatbase.co/docs/user-guides/chatbot/actions/actions-overview.md#credit-usage).

## Next steps

Once your store is connected, enable the **Actions** that let your AI agent help customers with product search, order lookups, cart management, and more.

![The first half of the Shopify Actions list: Retrieve and display products, Update cart, Create order, Create exchange (new order), and Create return or exchange (same order)](https://mintcdn.com/chatbase/kRgbduNouxB30eyE/user-guides/integrations/images/shopify/shopify-actions-1.png?fit=max\&auto=format\&n=kRgbduNouxB30eyE\&q=85\&s=1f7879e7faa9073291b413a95596f3a4)

![The second half of the Shopify Actions list: Get cart, Retrieve and display orders, Update customer profile, Update billing address, Check account, and Tag an order](https://mintcdn.com/chatbase/kRgbduNouxB30eyE/user-guides/integrations/images/shopify/shopify-actions-2.png?fit=max\&auto=format\&n=kRgbduNouxB30eyE\&q=85\&s=5b4faf8725600edbd4fd3ac03339c5f5)

> [!NOTE]
>
> With the **Retrieve and display products** Action enabled, you don't need to train your AI agent on your product or collection pages. The Action syncs your catalog directly from Shopify, so exclude `/products` and `/collections` from your website training source. See [Sync your products](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md#sync-your-products).

> [card] [Shopify Actions](https://chatbase.co/docs/user-guides/chatbot/actions/shopify-actions.md)
>
> Configure and use Shopify Actions to help customers browse products, manage their cart, place orders, return and exchange items, track deliveries, and update their account information.

[YouTube video player](https://www.youtube.com/embed/A-5U72lw7Hk)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.