Get started

Shopify

Connect Shopify to Hay so your AI agent can look up orders, track shipments, handle refunds and returns, and recommend real products from your catalog.

What is Shopify?#

Shopify is one of the world's most popular e-commerce platforms, used by millions of merchants to run their online stores. Connecting Shopify to Hay gives your AI agent direct access to your store's orders, customers, products, and inventory — so it can answer "where is my order?" questions, process cancellations, refunds, and returns, and recommend products from your real catalog, all without a human agent touching the keyboard.

How to Connect Shopify#

  1. Go to Integrations → Marketplace in the Hay dashboard
  2. Find Shopify and click Connect
  3. Leave Connection mode set to Managed (recommended)
  4. Enter your Store domain — your myshopify.com address, e.g. mystore.myshopify.com (without https://). You can find it in your Shopify admin under Settings → Domains
  5. Save, then click Connect with Shopify
  6. Approve the requested permissions on the Shopify screen that opens
  7. Done — Hay confirms the connection and your agent can start using the store

The plugin also has a Self-hosted (own app) connection mode for teams that run their own Hay installation and their own Shopify app: instead of the one-click connect, you enter your app's Client ID and Client secret, and Hay refreshes the short-lived access token for you automatically every 20 hours. See the Shopify plugin README for the full self-hosted setup.

What Hay Can Do with Shopify#

Orders#

  • Look up an order by its order number (e.g. #1001)
  • Get an order's items, totals, shipping address, tracking, and support eligibility
  • List a customer's orders, most recent first
  • Get an order's fulfillment and shipment tracking status
  • Change where an undispatched order will ship (refused once fulfillment has started)
  • Add or replace the internal note on an order
  • Cancel an order — optionally restocking items, refunding, and notifying the customer

Exchanges and item swaps#

  • Swap an item on an order that has not shipped for another variant of the same product (for example a different size)
  • Exchange delivered items for other variants: Hay.chat opens a Shopify return with the exchange items so the replacement is released
  • Email the payment link for an unpaid order, after the shopper's email or phone matches the order

Goodwill coupons#

The agent can create a single-use discount code as an apology. In the plugin settings, Allow goodwill coupons (on by default), maximum percentage (default 10%), maximum fixed amount (default 0, which turns fixed coupons off) and validity in days (default 30) set the limits. A coupon above the limits waits for a person to approve it.

Other settings#

On the Shopify settings page (Setup tab) you can also set Stale tracking: domestic (days) and Stale tracking: international (days), which decide when a shipment counts as stuck because its tracking has not moved, and How to return: your return process in your own words (where to send items, any link or form, deadlines). Hay.chat relays it as written when a customer asks how to return something. If it is empty, those questions go to your team.

Refunds & Returns#

  • Preview the correct refund amounts for an order before executing it
  • Execute a refund, bounded by Shopify's maximum refundable amount
  • List the fulfilled items on an order that are eligible for a return
  • Open a return for eligible items

Customers#

  • Find customers by email address and/or phone number
  • Get a customer's details, including their most recent orders
  • Update a customer's basic profile fields
  • Update a saved address on a customer's profile (does not change existing orders)

Products & Inventory#

  • Get a product by id or by its URL handle, including its variants
  • Search the store's products by title
  • Check stock levels for a product variant by id or SKU across all locations
  • Get basic information about the connected store (name, domain, plan, currency)

Product Catalog Sync#

Beyond the tools above, the Shopify plugin syncs your full product catalog into Hay in the background. That means your agent can search and recommend real products — with accurate prices, options, images, and availability — directly in conversations. The catalog re-syncs automatically on a schedule, and in self-hosted mode a background job also keeps your Shopify access token fresh so the connection never silently expires.

Add to cart from chat#

When the chat widget is on your Shopify storefront, the products your agent recommends show an Add to cart button. One click puts the product in the shopper's own cart without leaving the page, and the card then offers a Checkout link.

  • Turn it on or off with the Add to cart from chat setting in the Shopify plugin settings. It is on by default. When it is off, cards show only the link to the product.
  • Which products get the button: products published to your online store, with a variant that is available for sale. After you connect the store or change the setting, buttons appear once the next catalog sync has finished.
  • Where it works: on stores that use a Shopify theme. On a headless storefront the card falls back to its buy link.
  • Seeing which orders came from chat: each item added from chat carries a hidden property, _hay_conversation, with the conversation's id. Shopify hides it from the shopper at checkout and shows it on the order in your Shopify admin. Most themes also hide it on the cart page; if yours shows it, your theme prints every item property and needs to skip names starting with _.
  • Your theme's cart icon may not update until the next page load. If you want it to refresh immediately, your theme developer can listen for the hay:cart-updated event the widget fires on the page after each add.

Shopify gives the agent 25 tools. Refunds, cancellations, discounts and exchanges wait for a person to approve them by default; see Action approvals.

Your agent uses all of these tools automatically: when a customer asks "where's my order #1042?" or "can I get a refund?", the agent picks the right tool, checks your store, and answers with real data — escalating to your team when a decision needs a human.

Last updated November 11, 2026

View on GitHub