# Add an AI agent to your Shopify store > Connect your Shopify store so your AI agent can help shoppers find products, fill their cart, check out, track orders and manage their account The Shopify integration connects your store to a QwryAI agent, so the agent answers shoppers with your live catalog, cart and order data. It's for Shopify merchants who want one assistant before the purchase (finding products, filling the cart, checking out) and after it (tracking orders, returns and exchanges, account updates). Connecting the store installs the QwryAI app, and its app embed puts the Chat bubble on your storefront. Most Shopify Actions also run on WhatsApp, Instagram, Messenger and email. > [!WARNING] > > **You don't paste any embed code into your theme.** The QwryAI app adds the Chat bubble through a Shopify **app embed**. You switch it on once in Shopify's theme editor; see [Manage your integration](#manage-your-integration). ## What your AI agent can do for your store You choose what the agent can do by creating [Shopify Actions](/docs/user-guides/chatbot/actions/shopify-actions). **Before the purchase** | Shopper asks | What the 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 similar product | [Retrieve and display products](/docs/user-guides/chatbot/actions/shopify-actions#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](/docs/user-guides/chatbot/actions/shopify-actions#2-update-cart) | | "What's in my cart?" | Shows the items, quantities and total | [Get cart](/docs/user-guides/chatbot/actions/shopify-actions#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](/docs/user-guides/chatbot/actions/shopify-actions#4-create-order) | **After the purchase** | Shopper asks | What the agent does | Action | | - | - | - | | "Where is my order?" | Looks up the order status, tracking and purchase history | [Retrieve and display orders](/docs/user-guides/chatbot/actions/shopify-actions#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)](/docs/user-guides/chatbot/actions/shopify-actions#6-create-return-or-exchange-same-order) | | "Can I swap this for a size 10?" | Builds an exchange that a teammate approves in a Helpdesk ticket | [Create exchange (new order)](/docs/user-guides/chatbot/actions/shopify-actions#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 & send activation email](/docs/user-guides/chatbot/actions/shopify-actions#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 shopify customer profile](/docs/user-guides/chatbot/actions/shopify-actions#10-update-customer-profile), [Update shopify customer billing address](/docs/user-guides/chatbot/actions/shopify-actions#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](/docs/user-guides/chatbot/actions/escalate-to-human). ### Example: from product question to order tracking 1. A shopper opens the Chat bubble on your store and asks, "Do you have a waterproof jacket under $100?" The 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 agent uses **Update cart**, then asks whether they want anything else. 3. The shopper says, "Check out." The agent uses **Create order** and replies with a Shopify checkout link. 4. A few days later, the shopper asks, "Where is my order?" The agent uses **Retrieve and display orders**. A signed-in shopper's orders are found straight away; a guest is asked for the details that verify the order first. ## Before you start * A QwryAI account with an agent. If you haven't built one yet, follow [Your first AI agent](/docs/user-guides/quick-start/your-first-agent). * A Shopify store you can install apps on, and its original store name: the part before `.myshopify.com`. Your Shopify admin shows it under **Settings › Domains**. ## Connect your store You can start from **Integrations** or from **Channels**. Both install the QwryAI app in your store through Shopify's own approval screen. > [tab] From Integrations > > **1. Select Connect on the Shopify card** > > In your agent's sidebar, open **Integrations** and select **Connect** on the **Shopify** card. > > ![The Shopify card on the Integrations page, Connect your Shopify store to QwryAI., with the pointer on Connect.](annotated/01-integrations-card.webp "Integrations › Shopify › Connect.") > > **2. Review Connect Shopify** > > The **Connect Shopify** dialog asks for your **Shop name** and explains the install flow: you're sent to Shopify to approve access, then returned to Integrations. > > ![The Connect Shopify dialog with the Shop name field, the help on finding the shop name in your myshopify.com URL and the OAuth install flow, and the Cancel and Connect Shopify buttons.](annotated/02-connect-dialog--open.webp "Enter your Shop name, then Connect Shopify.") > > **3. Enter your Shop name** > > Type the subdomain only. For `https://your-store.myshopify.com/admin`, that's `your-store`. Then select **Connect Shopify**. > > ![The Connect Shopify dialog with your-store typed in Shop name, above the Connect Shopify button.](annotated/03-shop-name.webp "Type the subdomain before .myshopify.com.") > [tab] From Channels > > **1. Select Setup on the Shopify card** > > In your agent's sidebar, open **Channels** and select **Setup** on the **Shopify** card. > > ![The Shopify card on the Channels page, Connect your agent to Shopify and let it respond to messages from your customers., with the pointer on Setup.](annotated/04-channels-card.webp "Channels › Shopify › Setup.") > > **2. Enter your store name** > > A **Shopify Integration** window opens: *Allow QwryAI to access your Shopify Account?* Type your original store name between `https://` and `.myshopify.com/`, then select **Submit**. > > ![The Shopify Integration window, Allow QwryAI to access your Shopify Account?, with the your-store placeholder between https:// and .myshopify.com/, and the Close and Submit buttons.](annotated/05-connect-window.webp "The Shopify Integration window asks for your store name.") **Approve the app in Shopify** Shopify opens its install screen for the QwryAI app and lists the access it needs. Review it and select **Install**. You're returned to QwryAI: from Integrations with *Shopify connected successfully.*, and from Channels with **Shopify connected** and the Shopify page opening. ![Connecting a store: entering the Shop name, selecting Connect Shopify, approving the QwryAI app on Shopify's install screen, and returning to QwryAI with the Shopify card showing Connected.](walkthroughs/shopify-connect.gif) > [!NOTE] > > If Shopify doesn't finish the approval, QwryAI shows *Shopify connection failed. Please try again.* A store name that isn't a valid `myshopify.com` name shows *Enter a valid original Shopify store name.* ### Manage your integration **1. Open the Shopify page** On **Channels**, select **Manage** on the **Shopify** card. ![The Shopify card on the Channels page with the pointer on Manage.](connected/annotated/c01-channels-manage.webp "Channels › Shopify › Manage.") **2. Check the toggle** Make sure the toggle at the top right of the page is on. It's the Chat bubble's visibility: while it's off, the bubble doesn't show on your store. ![The Shopify page with the Chat bubble visibility toggle at the top right switched on, and How to embed the app in a theme: the App embeds illustration, Select the theme you want to use, Open Shopify Theme Editor, and links to the actions page and the Chat bubble page.](connected/annotated/c02-shopify-page.webp "Keep the toggle at the top right on.") **3. Turn on the app embed** Under **How to embed the app in a theme**, pick your live theme in **Select the theme you want to use**, then select **Open theme editor**. In Shopify's theme editor, open **App embeds**, switch **QwryAI** on and select **Save**. ![The Theme dropdown open under Select the theme you want to use, listing the store's themes with the live theme marked (Live), above the Open theme editor button.](connected/annotated/c03-theme.webp "Pick your live theme, then Open theme editor.") ![In Shopify's theme editor: opening App embeds, switching the QwryAI embed on, selecting Save, and opening the storefront where the Chat bubble appears.](walkthroughs/shopify-app-embed.gif) The page's last two steps link to the **actions page**, to create your Shopify Actions, and to the **Chat bubble** page, to change how the bubble looks. > [!TIP] > > Open your storefront and check that the Chat bubble appears and answers. If it doesn't, check the toggle in either of these places: > > * **Channels › Chat bubble › Manage**: on the **Overview** tab, **Visibility** must be on. > * **Channels › Shopify › Manage**: the toggle at the top right must be on. > > Then check that the **QwryAI** app embed is on for your live theme. ![The Visibility toggle switched on in the Chat bubble's Overview tab.](annotated/06-visibility.webp "Visibility must be on for the Chat bubble to show.") ## Setup checklist Work through these in order to go from a connected store to an agent that's ready for shoppers: 1. **Connect your store** 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 Retrieve and display products and sync your catalog.** See [Sync your products](/docs/user-guides/chatbot/actions/shopify-actions#sync-your-products). 4. **Create your first Actions.** See [Which Actions to turn on first](#which-actions-to-turn-on-first). 5. **Test on your live storefront.** The Preview has no signed-in shopper and no storefront cart, so test cart, checkout and account flows from the Chat bubble on your store. 6. **Publish, then add Tests.** [Tests](/docs/user-guides/chatbot/tests) check your agent with real questions, such as a shopper asking where order #1042 is, with **Retrieve and display orders** as the Action you expect. ## What to train your AI agent on Shopify Actions give the agent your live products, carts and orders. [Data sources](/docs/user-guides/chatbot/data-sources) give it everything else shoppers ask about: your policies and how your store works. **Train on:** * Shipping pages: where you ship, delivery times and costs * Your returns and exchanges policy: the window, condition rules and who pays return shipping * FAQ and help pages, size guides, care instructions and contact details * Answers you want worded exactly, added as **Q&A Pairs** **Don't train on product or collection pages.** With **Retrieve and display products** created, your catalog syncs directly from Shopify and stays current. Scraped product and collection pages go stale and compete with the synced data, which leads to old prices and out-of-stock items in answers. If your website is a data source, exclude its `/products` and `/collections` pages. > [!TIP] > > To add your store's website as a source, choose **Sitemap** and give it `/sitemap.xml` instead of crawling the whole store. That uses less of your training content limit and avoids duplicate product pages. When you change a data source, such as your returns policy, it shows **Training** while it trains and **Synced** once your agent can use it. That usually takes a few minutes. ## 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](/docs/user-guides/chatbot/actions/shopify-actions#1-retrieve-and-display-products), [Update cart](/docs/user-guides/chatbot/actions/shopify-actions#2-update-cart) and [Get cart](/docs/user-guides/chatbot/actions/shopify-actions#3-get-cart). 2. **Order tracking:** [Retrieve and display orders](/docs/user-guides/chatbot/actions/shopify-actions#7-retrieve-and-display-orders), so "where is my order?" is answered without a ticket, 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 a Helpdesk ticket. To control when either runs, call it from a [Procedure](/docs/user-guides/chatbot/procedures/procedures-overview). See [Keeping high-stakes Actions on rails](/docs/user-guides/chatbot/actions/shopify-actions#keeping-high-stakes-actions-on-rails). 4. **Checkout:** [Create order](/docs/user-guides/chatbot/actions/shopify-actions#4-create-order), so shoppers can place the order in the chat. Create **Update cart** too whenever **Create order** uses the cart, or the cart stays empty. > [!NOTE] > > Each Shopify Action counts toward your agent's Action limit: 4 on **Starter**, 12 on **Growth**, and no limit on **Enterprise**. The five Actions in steps 1, 2 and 4 cover product discovery, checkout and order tracking. ## Limitations * **One agent on the storefront.** Your store shows one agent's Chat bubble. If you connect the same store to another agent, the storefront moves to the agent connected most recently. * **Placed orders change only through a return.** No Shopify Action cancels an order or changes its shipping address. * **Phone isn't supported.** Shopify Actions run on chat, messaging and email channels. ## Frequently asked questions > [accordion] Do I need to add embed code to my Shopify theme? > > No. The QwryAI app adds the Chat bubble through its app embed. If you don't see it, check that the toggle on the Shopify **Manage** page is on and that the **QwryAI** app embed is on in your theme editor. > [accordion] Should I train my 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 agent track orders for shoppers who aren't signed in? > > Yes. Signed-in shoppers' orders are found automatically. Guests verify the order first. See [Signed-in and guest customers](/docs/user-guides/chatbot/actions/shopify-actions#signed-in-and-guest-customers). > [accordion] Can the agent cancel an order or change a shipping address? > > No. Route those requests to your team with [Escalations](/docs/user-guides/chatbot/actions/escalate-to-human). > [accordion] Where do I find my store name? > > In your Shopify admin under **Settings › Domains**: it's the part before `.myshopify.com`, even if your store uses its own domain. ## Next steps Once your store is connected, create the Actions that let your agent search products, look up orders and manage carts. ![Build › Actions › Create Action with the Shopify card selected, listing Retrieve and display products, Update cart, Get cart, Create order, Create exchange (new order), Create return or exchange (same order), Retrieve and display orders, Tag an order, the account Actions and Read metafields.](walkthroughs/shopify-actions-list.gif) > [!NOTE] > > With **Retrieve and display products** created, you don't need to train your agent on product or collection pages. See [Sync your products](/docs/user-guides/chatbot/actions/shopify-actions#sync-your-products). > [card] Shopify Actions | /docs/user-guides/chatbot/actions/shopify-actions | Help shoppers browse products, manage their cart, place orders, return and exchange items, track deliveries and update their account.