# Shopify Actions: products, cart, orders and returns in chat > Help shoppers find products, manage their cart, place orders, return and exchange items, track deliveries and update their account through your AI agent Shopify Actions let your QwryAI agent work with your Shopify store: search the catalog, manage the shopper's cart, place orders, look up and tag orders, handle returns and exchanges, update customer accounts and read your custom fields. They're for Shopify merchants who want the agent to resolve shopper requests in the conversation instead of only describing how. Each Shopify Action is a separate Action with its own name, **When to use** and channels. > [!NOTE] > > **Prerequisite:** connect your store before you add a Shopify Action. See [Shopify](/docs/user-guides/integrations/shopify). ![The Integrations page filtered to Shopify, with the pointer on the Connect button of the Shopify card.](annotated/03-integrations.webp "Integrations › Shopify › Connect.") To connect, go to **Integrations**, find **Shopify** and select **Connect**. Enter your **Shop name**, the subdomain before `.myshopify.com` (for `https://example.myshopify.com/admin` it's `example`), then select **Connect Shopify**. You're sent to Shopify to approve access, then back to QwryAI. ![The Shopify connect dialog with the Shop name field, help on finding the shop name in your myshopify.com URL, and the Cancel and Connect Shopify buttons.](annotated/04-connect-form--open.webp "Enter your Shop name.") ![The Shop name field with your-store typed in it, above the Connect Shopify button.](annotated/05-shop-name.webp "Type the subdomain before .myshopify.com.") ## Available Shopify Actions | Action | What it does | | - | - | | [Retrieve and display products](#1-retrieve-and-display-products) | Search your catalog and show products the shopper can add to their cart | | [Update cart](#2-update-cart) | Add, remove or change the quantity of items in the cart | | [Get cart](#3-get-cart) | Show what's in the shopper's cart and its total | | [Create order](#4-create-order) | Place an order from the cart or from specific items, paid online, cash on delivery, or free | | [Create exchange (new order)](#5-create-exchange-new-order) | Swap items from a past order for replacements on a new exchange order, approved by your team in a Helpdesk ticket | | [Create return or exchange (same order)](#6-create-return-or-exchange-same-order) | Refund or swap items on the customer's existing order. The only Action that takes a plain return | | [Retrieve and display orders](#7-retrieve-and-display-orders) | Look up order status, tracking and purchase history | | [Tag an order](#8-tag-an-order) | Add tags you choose to the signed-in customer's order | | [Check account & send activation email](#9-check-account-and-send-activation-email) | Check whether the shopper is signed in, and email an activation link if their account was never activated | | [Update shopify customer profile](#10-update-customer-profile) | Change the signed-in customer's name, email or phone number | | [Update shopify customer billing address](#11-update-customer-billing-address) | Add or update the signed-in customer's billing address | | [Read metafields](#12-read-metafields) | Answer from custom metafields you keep in Shopify | ![The Shopify card in Create Action with chips for Retrieve and display products, Update cart, Create order, Create exchange (new order), Create return or exchange (same order), Get cart, Retrieve and display orders and the account Actions.](annotated/02-card-chips.webp "The Shopify card lists the Shopify Actions.") ## Common shopper requests | Shopper request | Example | Action to enable | | - | - | - | | Where is my order? | "What's the status of order #1234?" | [Retrieve and display orders](#7-retrieve-and-display-orders) | | Return an item for a refund | "Can I send this back for a refund?" | [Create return or exchange (same order)](#6-create-return-or-exchange-same-order) | | Exchange an item | "Can I swap this for the black one?" | [Create exchange (new order)](#5-create-exchange-new-order) for approval in the Helpdesk, or [Create return or exchange (same order)](#6-create-return-or-exchange-same-order) with **Allow exchanges** on | | Damaged or missing item | "My order arrived damaged" | [Tag an order](#8-tag-an-order) plus a [Create order](#4-create-order) set to **Free order**, run from a Procedure. See [Keeping high-stakes Actions on rails](#keeping-high-stakes-actions-on-rails) | | Cancel an order or change its address | "Can you cancel my order?" | No Shopify Action does this. Route it to your team with [Escalations](/docs/user-guides/chatbot/actions/escalate-to-human) | | Find a product | "Show me red dresses under $50", or a photo | [Retrieve and display products](#1-retrieve-and-display-products) | | Change the cart | "Add two of these" | [Update cart](#2-update-cart) | | Review the cart | "What's in my cart?" | [Get cart](#3-get-cart) | | Check out | "I'm ready to check out" | [Create order](#4-create-order), with [Update cart](#2-update-cart) when it uses the cart | | Can't sign in | "I never got an activation email" | [Check account & send activation email](#9-check-account-and-send-activation-email) | | Update account details | "Change my phone number" | [Update shopify customer profile](#10-update-customer-profile) | | Update a billing address | "I moved" | [Update shopify customer billing address](#11-update-customer-billing-address). This changes the account, not a placed order | | Product details you keep in custom fields | "How do I wash this jacket?" | [Read metafields](#12-read-metafields) | ## Signed-in and guest customers Some Actions read or change one customer's data, so they need a shopper who is signed in to your store. On the Chat bubble in your store, the QwryAI Shopify app passes the signed-in customer to your agent with a signed token, and QwryAI checks it with Shopify. An email sender or a messaging contact isn't treated as proof of a Shopify account. | Action | Who can use it | | - | - | | Retrieve and display products, Update cart, Get cart | Anyone | | Create order | Anyone. The agent collects the details it needs in the conversation | | Check account & send activation email | Anyone. It exists to get guests signed in | | Retrieve and display orders | Anyone, but guests must verify the order (see below) | | Create exchange (new order), Create return or exchange (same order) | Anyone who can identify the past order, the same way as order lookup | | Tag an order | **Signed-in customers only** | | Update shopify customer profile | **Signed-in customers only** | | Update shopify customer billing address | **Signed-in customers only** | > [!NOTE] > > **How guests verify an order.** A signed-in customer's orders come straight from their account. A guest gives the order number with either the checkout email or the phone number on the order. With [**Search by confirmation number**](#search-by-confirmation-number) on, the confirmation number works in place of the order number. > [!WARNING] > > The **Preview** beside the Action editor has no signed-in shopper, so Actions marked signed-in only can't be tested there. Test them on the Chat bubble in your store while signed in. ## How to create a Shopify Action Every Shopify Action is created the same way. The [Action sections](#actions) below list what differs: the default name and **When to use**, and any extra settings. **1. Open Create Action** Open the agent connected to your store and go to **Build › Actions**. Select the **Create Action** tab, then the **Shopify** card. Type `Shopify` in **Search** to find it quickly. ![The Create Action tab with Shopify typed in Search, showing the Shopify card.](annotated/00-search.webp "Search Create Action for Shopify.") ![The Create Action gallery with the pointer on the Shopify card, which recommends products, answers order questions and provides delivery updates, with its capability chips.](annotated/01-gallery.webp "Create Action › Shopify.") **2. Pick the Action** The **Shopify** dialog lists every Shopify Action with how many are available. Select the one you want. If your store isn't connected yet, the dialog shows **Connect Shopify** instead, with a **Connect** button that starts the same connection. ![The Shopify dialog with Connect Shopify to choose an action, an example product card with Add to cart, and the Connect button.](annotated/01-gallery--open.webp "Connect Shopify to choose an Action.") **3. Check General** **Action name** and **When to use** come filled in with working defaults, listed in each Action's section. Leave them unless you need a change; **Reset** restores them. To run the Action only from a [Procedure](/docs/user-guides/chatbot/procedures/procedures-overview) step, turn on [**Only use in Procedures**](/docs/user-guides/chatbot/actions/actions-overview#only-use-in-procedures). Select **Continue**. ![The General section of a Shopify get products Action with Get_Products in Action name, the default When to use and the Only use in Procedures switch.](annotated/12-products-general.webp "Retrieve and display products: General.") **4. Fill in the Action's own settings** A few Actions add a section here. **Retrieve and display products** adds **Products** for syncing your catalog. **Create order**, **Create exchange (new order)** and **Create return or exchange (same order)** add **Behavior**, and **Create exchange (new order)** also adds **Details collection**. The other Actions go straight to **Channels**. **5. Choose channels** Turn the Action on or off for each configured channel. Compatible channels differ per Action: see [Channel compatibility](#channel-compatibility). **6. Enable and test** Select **Enable**, then test with the check in the Action's section. > [!TIP] > > You can add **Create order** more than once, each with its own name and **Behavior**. See [Create order](#4-create-order). ## Channel compatibility | Action | Compatible channels | | - | - | | Retrieve and display products | Chat bubble, Help page, Email, Instagram, Messenger, WhatsApp | | Update cart | Chat bubble, Help page, Email, Instagram, Messenger, WhatsApp | | Get cart | Chat bubble, Help page, Email, Instagram, Messenger, WhatsApp | | Create order | Chat bubble, Help page, Email, Instagram, Messenger, WhatsApp | | Create exchange (new order) | Chat bubble, Help page, Email, Instagram, Messenger, WhatsApp | | Retrieve and display orders | Chat bubble, Help page, Email, Instagram, Messenger, WhatsApp | | Create return or exchange (same order) | Chat bubble, Help page, Email | | Check account & send activation email | Chat bubble, Help page, Email | | Read metafields | Chat bubble, Help page, Email | | Tag an order | Chat bubble, Help page | | Update shopify customer profile | Chat bubble, Help page | | Update shopify customer billing address | Chat bubble, Help page | Any channel not listed is incompatible and can't be selected. See [Channels](/docs/user-guides/chatbot/actions/actions-overview#channels). ## Actions ### 1. Retrieve and display products Search your Shopify catalog and show products as cards the shopper can add to their cart. Shoppers can also search by photo: send a picture as an attachment and the agent finds matching products, even when the product name never comes up. **Best for:** product discovery, stock and price questions, comparing items, and adding to the cart from the chat. **Common use cases:** * "Show me red dresses under $50" * "What laptops do you have in stock?" * "How much is this?" (with a photo attached) #### Settings **Action name:** `Get_Products`. The editor opens as **Shopify get products**. **When to use:** *If the user ask about products, use this tool. Summarize the tool's result in your response, ensuring no images are included within the text response.* #### Sync your products In **Products**, select **Sync and continue** to import your catalog. The first sync can take a while on a large store. When it's done, the section shows how many products were synced, and **Continue** opens **Channels**. After the first sync your products stay up to date automatically. To rebuild the catalog, select **Re-sync products**, which you can do twice a week. ![The Products section with the sync explanation, the Exclude out-of-stock products switch, the synced product count, and the Edit product cards, Re-sync products and Continue buttons.](annotated/13-products-sync.webp "Products: sync your catalog.") > [!WARNING] > > **Don't train your agent on product or collection pages.** The sync already gives your agent your whole catalog, kept current. Scraped product pages go stale and compete with it, which leads to old prices and out-of-stock items in answers. If your website is a [data source](/docs/user-guides/chatbot/data-sources), exclude its `/products` and `/collections` pages. > [!TIP] > > Ask the **Preview** product questions and check the results against your store. ![A shopper on the Chat bubble asks for running shoes under $100, the agent replies with product cards showing images, prices and Add to cart buttons, and the shopper adds one to the cart.](walkthroughs/shopify-products.gif) #### Exclude out-of-stock products Out-of-stock products are included by default, so your agent can still tell shoppers about items that are temporarily unavailable. To hide them, turn on **Exclude out-of-stock products** in **Products**. Products with no in-stock variants are then left out of searches. The change applies straight away, with no re-sync. #### Edit product cards Once products are synced, **Edit product cards** in **Products** opens the product card in the widget editor, where you can change its layout. Changes apply to new product replies. #### Search by image When a shopper sends a photo, for example a screenshot from social media, the agent finds the matching products in your catalog and shows them with the usual buttons. QwryAI learns your product images during the sync, so there's nothing to set up. It works on every channel that accepts [attachments](/docs/user-guides/chatbot/channels). #### Products on messaging channels On WhatsApp, each product arrives as a message with its image, title, price and a **View Product** button, up to three at a time, with any others listed as text. On Instagram and Messenger, products arrive as a swipeable set of cards. See [WhatsApp product cards](/docs/user-guides/chatbot/actions/whatsapp-catalog). #### Keep your theme's cart icon in sync When the agent changes the cart on the Chat bubble, QwryAI fires DOM events so your theme can refresh its cart count without a page reload: ```js document.documentElement.dispatchEvent(new CustomEvent('cart:updated', { detail, bubbles: true })); document.documentElement.dispatchEvent(new CustomEvent('cart-update', { detail, bubbles: true })); document.documentElement.dispatchEvent(new CustomEvent('cart:update', { detail, bubbles: true })); ``` `detail.newCart` holds the updated Shopify cart. Listen for any one of them in your theme: ```js document.addEventListener('cart:updated', (event) => { const cart = event.detail.newCart; document.querySelector('.cart-count').textContent = cart.item_count; }); ``` > [!NOTE] > > Three event names are fired so that more themes pick one up. You only need to listen to one. ### 2. Update cart Let shoppers add products, remove them or change quantities through the conversation. **Best for:** adjusting quantities, removing items and adding recommended products without leaving the chat. **Common use cases:** * "Add two of these to my cart" * "Remove the blue one" * "Make it three pairs" #### Settings **Action name:** `Update_Cart`. The editor opens as **Shopify update cart**. **When to use:** *Call this tool when the user wants to add a product to their cart, change the quantity of an existing line, or remove a line from the cart. After updating the cart, ask the user if they want to add more products or proceed with creating the order?* On the Chat bubble the Action changes the shopper's store cart in their browser. On messaging and email channels it keeps the cart as a draft order in Shopify. > [!TIP] > > Pair **Update cart** with [Create order](#4-create-order). The default **When to use** has the agent offer to place the order once the cart changes. ### 3. Get cart Show what's in the shopper's cart: items, quantities, prices and the total. **Best for:** letting shoppers review their cart before checkout. **Common use cases:** * "What's in my cart?" * "What's my total?" #### Settings **Action name:** `Get_Cart`. The editor opens as **Shopify get cart**. **When to use:** *Call this tool when asked about the cart, including the items in the cart, the total price, the quantity of items.* ![A shopper on the Chat bubble asks what's in their cart and the agent shows a cart card with the items, quantities and total.](walkthroughs/shopify-cart.gif) ### 4. Create order Place a Shopify order for the shopper from the conversation, built from their cart or from specific items, and paid online, cash on delivery or free. **Best for:** checking out in the chat, cash-on-delivery stores, and free replacement or gift orders. **Common use cases:** * "I'm ready to check out" * "Place the order for what's in my cart" #### Settings **Action name:** `Create_Order`. The editor opens as **Shopify create order**. **When to use:** *Call this tool when the user wants to place an order.* #### Behavior **Order items:** where the items come from. | Option | What it does | | - | - | | **Use the cart** (default) | Orders whatever the shopper has added to their cart, then empties the cart. Enable [Update cart](#2-update-cart) too, so the agent can fill it. | | **Skip the cart** | Orders items the agent or a Procedure provides. The cart isn't read or changed. Used for replacements, gifts and buy-it-now flows. | **Order payment:** how the shopper pays. | Option | What it does | | - | - | | **Online payment** (default) | Sends the shopper a secure Shopify-hosted checkout link. Shopify completes the order once they pay. | | **Cash on delivery** | The shopper pays when the order arrives. | | **Free order** | No payment and no checkout link. Use it for replacements and free gifts. | **Shipping address phone number:** | Option | What it does | | - | - | | **Required** (default) | The agent must collect a phone number before placing the order. | | **Don't include** | The agent never asks for one. | | **Optional** | The agent asks, and places the order anyway if the shopper declines. | ![The Behavior section of a Shopify create order Action with Order items (Use the cart, Skip the cart), Order payment (Online payment, Cash on delivery, Free order), Shipping address phone number, Order tags and Order note.](annotated/14-order-behavior.webp "Create order: Behavior.") **Order tags:** tags added to every order this Action creates, so you can find them in Shopify. The default is `qwryai`. Up to 20 tags, 40 characters each, no commas. **Order note:** saved on every order. The default is `Placed via QwryAI AI agent ({{paymentModeLabel}})`. **Add variable** inserts `{{paymentModeLabel}}` ("Cash on Delivery", "100% Free" or "Online Payment"), `{{customerFirstName}}`, `{{customerLastName}}`, `{{customerEmail}}`, `{{lineItemsSummary}}`, `{{shippingAddressSummary}}` or `{{conversationId}}`, and **Reset** restores the default. > [!TIP] > > Add an item to the cart on the Chat bubble and ask the agent to place the order. With **Online payment**, it replies with a Shopify checkout link. > [!TIP] > > **Add Create order more than once** with different settings and names. For example, keep `Create_Order` (**Use the cart** + **Online payment**) for checkout, and add `Create_Replacement_Order` (**Skip the cart** + **Free order**) for replacements, with **Only use in Procedures** on. ### 5. Create exchange (new order) Handle an exchange against a past order. The agent builds an exchange draft order that credits the returned items toward their replacements, then opens a ticket in your QwryAI [Helpdesk](/docs/user-guides/chatbot/help-desk/help-desk-overview) so a teammate can approve or reject it. Nothing is placed in Shopify until someone approves. This Action only swaps items. For a refund, use [Create return or exchange (same order)](#6-create-return-or-exchange-same-order). **Best for:** size and color swaps, wrong or faulty items, and any exchange you want a person to approve first. **Common use cases:** * "I'd like to exchange these for a size 10" * "Can I swap this for the black version?" > [!NOTE] > > When a teammate approves, QwryAI places the exchange in Shopify and tells the customer in the conversation: either their new order number, or a checkout link for any balance to pay. A rejection tells the customer *Your exchange was not approved.* #### Settings **Action name:** `Create_Exchange`. The editor opens as **Shopify create exchange**. **When to use:** *Call this tool when the user wants to do a product exchange* #### Behavior **Shipping address phone number:** **Required** (default), **Don't include** or **Optional**, as for Create order. **Order tags:** tags added to the exchange order. The default is `qwryai`. **Order note:** saved on the exchange order. The default is: ```text Exchange for order {{oldOrderName}} Returning: {{exchangedItemsSummary}} Exchanging for: {{newItemsSummary}} Reason: {{reason}} ({{faultLabel}} → {{shippingLabel}} shipping) Items: {{itemsSettlement}} Shipping: {{shippingSettlement}} Tax: {{taxSettlement}} Net: {{netSettlement}} ``` ![The Behavior section of a Shopify create exchange Action with Shipping address phone number, Order tags and the default exchange Order note.](annotated/15-exchange-behavior.webp "Create exchange: Behavior.") | Variable | Description | | - | - | | `{{oldOrderName}}` | The original order number, for example `#1042` | | `{{exchangedItemsSummary}}` | The returned items, for example `Red tee (SKU-1) x2` | | `{{newItemsSummary}}` | The replacement items and quantities | | `{{reason}}` | The shopper's reason | | `{{faultLabel}}` | Merchant fault or customer request | | `{{shippingLabel}}` | Free or paid shipping | | `{{itemsSettlement}}` | Replacement items minus the returned item credit | | `{{shippingSettlement}}` | The shipping amount | | `{{taxSettlement}}` | Tax calculated by Shopify | | `{{netSettlement}}` | The amount to collect or refund | | `{{conversationId}}` | The conversation's reference | #### Details collection (optional) Under **Collect additional details**, add fields the agent gathers before it opens the exchange ticket, for example a photo of the item. Select **Add data input**, then give each field a **Name**, a **Type** (**Text** or **Image**) and a **Description** of what to ask for. Uncheck **Required** to let the agent open the exchange without that field. Select **Continue**, or **Skip** if you don't need extra details. ![The Details collection section of a Shopify create exchange Action with Collect additional details and the Skip and Continue buttons.](annotated/16-exchange-details.webp "Create exchange: Details collection.") > [!TIP] > > Ask the agent to exchange an item from a past order. A ticket should appear in your Helpdesk, and the exchange reaches Shopify only after you approve it. ### 6. Create return or exchange (same order) Handle a return on the customer's existing order, without creating a new one. Returned items are refunded, or swapped for other products if you allow exchanges, by editing the original order. This is the only Shopify Action that takes a plain return. **Best for:** self-service refunds, and swaps you're happy for the agent to complete on its own within a return window you set. > [!NOTE] > > **This Action completes on its own.** The agent opens the return in Shopify during the conversation, with no Helpdesk ticket and no approval step. Put it behind a Procedure if you want checks first. **Common use cases:** * "I want to return these shoes" * "Can I send this back for a refund?" * "I'd like to swap this for a size 10", with **Allow exchanges** on | Difference | Create exchange (new order) | Create return or exchange (same order) | | - | - | - | | Plain returns (refunds) | Not supported | Supported | | What it creates | An exchange draft order against the past order | A return on the existing order | | Approval | Always, in a Helpdesk ticket | None | | Extra details | Can collect fields such as a photo | Not available | | Time limit | None | **Return window (days)**, 30 by default | #### Settings **Action name:** `Create_Return`. The editor opens as **Shopify create return**. **When to use:** *Call this tool when the customer wants to return, send back, or swap item(s) from a past order.* #### Behavior **Return window (days):** how many days after an order is placed it can still be returned. The default is 30; leave it empty for no limit. Outside the window, the agent tells the customer the order is outside the return window. **Allow exchanges:** off by default. Turn it on to let the agent swap returned items for other products in the same return, with Shopify settling any price difference. With it off, the Action only refunds. ![The Behavior section of a Shopify create return Action with Return window (days) set to 30 and the Allow exchanges switch.](annotated/17-return-behavior.webp "Create return: Behavior.") > [!TIP] > > Ask the agent to return an item from a recent order. The return should appear on that same order in Shopify. Then try an order older than your window and check the agent declines. ### 7. Retrieve and display orders Look up orders: status, purchase history and the details of a specific order. **Best for:** "Where is my order?" questions, tracking links and purchase history. **Common use cases:** * "Where is my order?" * "Show me my recent orders" * "What's the status of order #1234?" > [!NOTE] > > **Status and tracking** come straight from Shopify. For each shipment the agent also gets the carrier, tracking number, tracking link and shipment status saved on the fulfillment. A carrier or app that sends delivery updates to Shopify gives the most accurate status. #### Settings **Action name:** `Get_Orders`. The editor opens as **Shopify get orders**. **When to use:** *If the user ask about orders, use this tool. Summarize the tool's result in your response, ensuring no images are included within the text response.* #### Search by confirmation number Shopify gives each order an order number, such as `#1009`, and a confirmation number shown on the checkout thank-you page. Turn on **Search by confirmation number** in **General** to let guests find their order with either. Guests still give the checkout email or phone number, so they only ever see their own orders. It's off by default. ![The General section of a Shopify get orders Action with Get_Orders in Action name, the default When to use and the Search by confirmation number switch.](annotated/18-orders-general.webp "Retrieve and display orders: General.") ![A shopper on the Chat bubble asks where order #1042 is, gives their checkout email, and the agent shows an order card with its status and tracking link.](walkthroughs/shopify-orders.gif) ### 8. Tag an order Record the outcome of a conversation on the customer's order in Shopify, using tags you allow. **Best for:** marking orders "damaged", "missing item" or "address confirmed" from the chat, so your team and Shopify workflows can act on them. **Common use cases:** * Flagging an order when the customer reports a damaged item * Recording that the customer confirmed their delivery details #### Settings **Action name:** `tag_shopify_order`. The editor opens as **Shopify tag order**. **Allowed tags:** the only tags the agent can add to an order. The default is `qwryai`. Add the ones you want, such as `damaged` or `return-requested`. ![The General section of a Shopify tag order Action with tag_shopify_order in Action name, Allowed tags with qwryai, and the default When to use.](annotated/19-tag-order-general.webp "Tag an order: Allowed tags.") **When to use:** *Call this tool when something the customer says about an order should be recorded on the order.* > [!TIP] > > This Action needs a signed-in customer. Test it on the Chat bubble in your store while signed in. ### 9. Check account and send activation email Check whether the shopper is signed in to your store and, if their account was never activated, email them a link to activate it. **Best for:** getting guests signed in before Actions that need an account. **Common use cases:** * "How do I log in to my account?" * "I never got an activation email" #### Settings **Action name:** `check_account_access`. The editor opens as **Shopify account access**. **When to use:** *Call this tool when the customer cannot sign in to their store account, or never received the email to activate it. If it succeeds, tell the user that if the account exists, we sent an email.* ![The General section of a Shopify account access Action with check_account_access in Action name and the default When to use.](annotated/20-account-access-general.webp "Check account & send activation email: General.") ### 10. Update customer profile Let signed-in customers change their first name, last name, email or phone number. **Best for:** keeping contact details current without a support ticket. **Common use cases:** * "Update my email address" * "Change my phone number" #### Settings **Action name:** `Update_Profile`. The editor opens as **Shopify update profile**. **When to use:** *Call this tool when asked about changing customer profile, including first name, last name, email, or phone number.* ![A signed-in shopper on the Chat bubble asks to change their phone number, confirms the new number, and the agent confirms the profile was updated.](walkthroughs/shopify-profile.gif) ### 11. Update customer billing address Let signed-in customers add a billing address, update one, or change their default address. **Best for:** self-service address changes on the customer's account. **Common use cases:** * "Update my billing address" * "I moved and need to change my address" > [!NOTE] > > This changes the address on the **customer's account**, not the shipping address of an order already placed. #### Settings **Action name:** `Update_Address`. The editor opens as **Shopify update address**. **When to use:** *Call this tool when asked about adding or updating billing addresses or changing the default address.* ![A signed-in shopper on the Chat bubble gives a new billing address and the agent confirms it was saved as the default.](walkthroughs/shopify-address.gif) ### 12. Read metafields Let the agent answer from custom fields you keep in Shopify, such as materials, care instructions or warranty details. #### Settings **Action name:** `Get_Metafields`. The editor opens as **Shopify get metafields**. **Metafields:** the metafields the agent may read, each added as `namespace.key` (for example `custom.care_instructions`) with what it belongs to: **Shop**, **Product**, **Variant**, **Collection**, **Order** or **Customer**. Find each key in Shopify under **Settings › Custom data**. Order and customer fields are read only for the signed-in customer. ![The General section of a Shopify get metafields Action with Get_Metafields in Action name, the Metafields field and the default When to use.](annotated/21-metafields-general.webp "Read metafields: General.") **When to use:** *Call this tool when the customer asks about details the store keeps in its custom fields, such as materials, care instructions, warranty or delivery information.* ## Keeping high-stakes Actions on rails Some Shopify Actions cost money or change a customer's record: a **Free order**, an exchange, a return, a tag that triggers a Shopify workflow. For those, use two settings together: 1. **[Only use in Procedures](/docs/user-guides/chatbot/actions/actions-overview#only-use-in-procedures)** on the Action, so it never runs on the agent's own judgment. 2. **Checks in the Procedure** before the step that calls the Action, so your rules live in a flow you wrote. A free-replacement Procedure might look like this: ```text 1. Use @Get_Orders to find the order the customer is asking about. 2. If the order was placed more than 30 days ago, use @create_ticket and stop. 3. Ask the customer for a photo of the damaged item. 4. Use @tag_shopify_order to add the damaged tag to the order. 5. Use @Create_Replacement_Order to send the replacement at no charge. ``` The agent can't reach step 5 without passing steps 2 to 4, so your window and evidence rules are enforced by the Procedure. See [Procedures](/docs/user-guides/chatbot/procedures/procedures-overview). ## Limitations * **Placed orders change only through a return.** No Shopify Action cancels an order or changes its shipping address. * **Same-order returns don't wait for a person.** Put them behind a Procedure if you need checks. * **Order status is only as good as your tracking data.** * **The Preview isn't a store session.** It has no signed-in shopper and no storefront cart, so test cart and account Actions on the Chat bubble in your store. * **Manual re-syncs are limited** to two a week. Normal product changes sync automatically. * **Phone isn't supported.** Shopify Actions run on chat, messaging and email channels. ## Troubleshooting > [accordion] The agent never uses a Shopify Action > > **Possible causes:** > > * The Action is off, or off for the customer's channel > * **Only use in Procedures** is on, but no Procedure step references it > * **When to use** doesn't match what customers ask > * The Action needs a signed-in customer and the shopper is a guest > > **Solutions:** > > * Enable the Action and check its **Channels** > * Reference it from a Procedure step, or turn **Only use in Procedures** off > * Rewrite **When to use** with the phrases customers type > * Add [Check account & send activation email](#9-check-account-and-send-activation-email) to help guests sign in > [accordion] Create order or an exchange doesn't work > > The Action depends on another Shopify Action that isn't enabled, or isn't in the same Procedure. > > | Action | Also enable | Why | > | - | - | - | > | Create order with **Use the cart** | Update cart | Without it the cart stays empty | > | Create exchange (new order) and Create return or exchange (same order) with **Allow exchanges** | Retrieve and display products | The agent finds the replacement with it | > > Enable the Action it needs on the same channels, and in a Procedure reference both in the same step. > [accordion] Products are missing, wrong or out of date > > Check the synced count in **Products**, confirm the product is active and published in Shopify, and remove scraped product pages from your website source. If needed, select **Re-sync products**. > [accordion] The agent can't update a profile, address or order tag > > These Actions act on the signed-in customer's own record. Test on the Chat bubble while signed in, not in the Preview. For **Tag an order**, check the tag is in **Allowed tags**. > [accordion] The theme's cart icon doesn't update after the agent adds an item > > Your theme isn't listening for the cart events. Add a listener for one of them. See [Keep your theme's cart icon in sync](#keep-your-themes-cart-icon-in-sync). > [accordion] An order was created but doesn't show as paid > > With **Online payment**, Shopify completes the order only after the shopper pays through the checkout link. For orders without payment, use a **Free order** variant. > [accordion] An approved exchange didn't reach Shopify > > Check the ticket in your Helpdesk: the exchange is placed only once a teammate approves it. A rejected ticket never reaches Shopify. If required **Collect additional details** fields were never collected, the ticket wasn't opened. > [accordion] The agent won't return an item, or only offers a refund > > The order may be outside **Return window (days)**, or **Allow exchanges** is off. Raise or clear the window, or turn exchanges on in **Behavior**. ## Best practices > [card] Clear Action triggers | /docs/user-guides/chatbot/actions/actions-overview | Write specific **When to use** text with phrases customers actually use. > [card] Test thoroughly | /docs/user-guides/chatbot/playground | Try each Action with real questions before going live, and check product results against your store. > [card] Keep products synced | /docs/user-guides/integrations/shopify | If products look wrong, check the count in **Products** and re-sync. > [card] Use Procedures | /docs/user-guides/chatbot/procedures/procedures-overview | Put exchanges, replacements and other high-stakes flows in a Procedure so the agent follows your steps. > [card] Match Actions to channels | /docs/user-guides/chatbot/channels | Turn signed-in-only Actions off where shoppers can't be signed in. > [card] Curate your tags | /docs/user-guides/integrations/shopify | Keep **Allowed tags** short and meaningful, so tags trigger the right workflows. ## Frequently asked questions > [accordion] Do shoppers need to be signed in? > > Only for **Tag an order**, **Update shopify customer profile** and **Update shopify customer billing address**. Products, the cart, checkout, order lookup, returns, exchanges and account activation work for guests. > [accordion] Which Action should handle returns? > > For a refund, **Create return or exchange (same order)**. For a swap a person should approve, **Create exchange (new order)**. > [accordion] Can the agent cancel an order? > > No. Add [Escalations](/docs/user-guides/chatbot/actions/escalate-to-human) so the agent hands those requests to your team. > [accordion] Why can't I test cart changes in the Preview? > > The Preview isn't a storefront session. Test cart and checkout on the Chat bubble in your store. > [accordion] How many Shopify Actions can I add? > > Each Shopify Action counts toward your agent's Action limit: 4 on **Starter**, 12 on **Growth**, and no limit on **Enterprise**. ## Next steps > [card] Shopify integration | /docs/user-guides/integrations/shopify | Connect your store and add the Chat bubble to it. > [card] WhatsApp product cards | /docs/user-guides/chatbot/actions/whatsapp-catalog | How products appear on WhatsApp. > [card] Procedures | /docs/user-guides/chatbot/procedures/procedures-overview | Put Shopify Actions into step-by-step flows.