AI Agent Management
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.
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.
Available Shopify Actions
| Action | What it does |
|---|---|
| Retrieve and display products | Search your catalog and show products the shopper can add to their cart |
| Update cart | Add, remove or change the quantity of items in the cart |
| Get cart | Show what's in the shopper's cart and its total |
| Create order | Place an order from the cart or from specific items, paid online, cash on delivery, or free |
| 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) | Refund or swap items on the customer's existing order. The only Action that takes a plain return |
| Retrieve and display orders | Look up order status, tracking and purchase history |
| Tag an order | Add tags you choose to the signed-in customer's order |
| Check account & 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 | Change the signed-in customer's name, email or phone number |
| Update shopify customer billing address | Add or update the signed-in customer's billing address |
| Read metafields | Answer from custom metafields you keep in Shopify |
Common shopper requests
| Shopper request | Example | Action to enable |
|---|---|---|
| Where is my order? | "What's the status of order #1234?" | Retrieve and display orders |
| Return an item for a refund | "Can I send this back for a refund?" | Create return or exchange (same order) |
| Exchange an item | "Can I swap this for the black one?" | Create exchange (new order) for approval in the Helpdesk, or Create return or exchange (same order) with Allow exchanges on |
| Damaged or missing item | "My order arrived damaged" | Tag an order plus a Create order set to Free order, run from a Procedure. See 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 |
| Find a product | "Show me red dresses under $50", or a photo | Retrieve and display products |
| Change the cart | "Add two of these" | Update cart |
| Review the cart | "What's in my cart?" | Get cart |
| Check out | "I'm ready to check out" | Create order, with Update cart when it uses the cart |
| Can't sign in | "I never got an activation email" | Check account & send activation email |
| Update account details | "Change my phone number" | Update shopify customer profile |
| Update a billing address | "I moved" | Update shopify 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 |
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 |
How to create a Shopify Action
Every Shopify Action is created the same way. The Action sections below list what differs: the default name and When to use, and any extra settings.
- 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
Shopifyin Search to find it quickly.Search Create Action for Shopify.
- 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.
Connect Shopify to choose an Action. - 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 step, turn on Only use in Procedures. Select Continue.
Retrieve and display products: General. - 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.
- Choose channels
Turn the Action on or off for each configured channel. Compatible channels differ per Action: see Channel compatibility.
- Enable and test
Select Enable, then test with the check in the Action's section.
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.
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.
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.
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.
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:
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:
document.addEventListener('cart:updated', (event) => {
const cart = event.detail.newCart;
document.querySelector('.cart-count').textContent = cart.item_count;
});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.
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.
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 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. |
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.
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 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).
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?"
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:
Exchange for order {{oldOrderName}}
Returning: {{exchangedItemsSummary}}
Exchanging for: {{newItemsSummary}}
Reason: {{reason}} ({{faultLabel}} → {{shippingLabel}} shipping)
Items: {{itemsSettlement}}
Shipping: {{shippingSettlement}}
Tax: {{taxSettlement}}
Net: {{netSettlement}}| 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.
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.
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.
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?"
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.
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.
When to use: Call this tool when something the customer says about an order should be recorded on the order.
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.
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.
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"
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.
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.
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:
- Only use in Procedures on the Action, so it never runs on the agent's own judgment.
- 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:
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.
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
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 to help guests sign in
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.
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.
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.
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.
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.
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.
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
Clear Action triggers
Write specific When to use text with phrases customers actually use.
Test thoroughly
Try each Action with real questions before going live, and check product results against your store.
Keep products synced
If products look wrong, check the count in Products and re-sync.
Use Procedures
Put exchanges, replacements and other high-stakes flows in a Procedure so the agent follows your steps.
Match Actions to channels
Turn signed-in-only Actions off where shoppers can't be signed in.
Curate your tags
Keep Allowed tags short and meaningful, so tags trigger the right workflows.
Frequently asked questions
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.
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).
Can the agent cancel an order?
No. Add Escalations so the agent hands those requests to your team.
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.
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.