AI Chatbots & Shopify: Why Your Products Might Show 'Out of Stock' (When They're Not!)
Hey there, fellow store owners! Let's talk about something that's been buzzing in the Shopify community and can be a real head-scratcher: AI chatbots incorrectly telling customers your products are out of stock when they're actually sitting pretty in your warehouse. It's frustrating, right? You know your inventory is good, but these clever Large Language Models (LLMs) seem to be getting the wrong idea.
Recently, a store owner named Becky (beckyfmartin) brought this exact issue to the community forum, asking for help because LLMs kept reporting her products as unavailable. The discussion that followed was a fantastic deep dive into how these AI agents 'read' our stores, and it uncovered some crucial insights that every Shopify merchant needs to know.
The Mystery of the 'Out of Stock' Ghost
Becky's initial thought was that the LLMs were simply scanning her theme's code, finding the words "out of stock" in a template string, and mistakenly assuming the product was unavailable. And honestly, that's a very logical first guess! Many themes *do* have these strings ready to display when a product actually sells out. But as several experts in the thread, like Maximus3 and Ploqo, pointed out, this is rarely the culprit.
Bristan_FARRE, who took a deep dive into Becky's actual product page, confirmed this. They found the `window.variantStrings` dictionary containing "Out of stock" was indeed present but was just a UI label dictionary, not an actual status. So, if an AI is smart enough to parse a web page, it's usually smart enough to know the difference between a UI label and a live inventory status.
Where LLMs *Actually* Get Their Info
So, if it's not the harmless theme text, what is it? The community discussion highlighted a few key areas:
1. Structured Data (Schema.org) – The AI's Rosetta Stone
This was the most emphasized point by many, including Jarid, Maximus3, and Appify_Commerce. LLMs and search engines heavily rely on structured data, specifically the `schema.org/Product` and `schema.org/Offer` blocks embedded in your product pages. This is machine-readable information that explicitly states things like product name, price, and, crucially, availability.
Bristan_FARRE's analysis of Becky's page showed that her primary Product block correctly reported `https://schema.org/InStock`. Good news there!
2. Duplicate or Broken Structured Data Blocks
Here's where things get tricky. Bristan_FARRE found a critical issue on Becky's page: two Product blocks. Even worse, the second one was invalid JSON due to an unescaped newline character inside the description. When you have conflicting or broken structured data, an AI crawler might pick the wrong one, or a parser error could lead to incorrect assumptions.
Vestfoldhall and Robert_Dainowski also flagged this as a common problem, often caused by SEO apps, review apps, or even theme customizations adding extra, sometimes conflicting, structured data.
3. Shopify's Agentic Sales Channels and Dedicated AI Feeds
This was a big revelation in the thread, brought up by v.marychenka, Robert_Dainowski, and Ploqo. Shopify now has built-in mechanisms for AI agents. Your store isn't just serving its regular product page to bots; it's also publishing inventory to dedicated "agentic storefronts" or feeds.
- Sales channels > Agentic: In your Shopify admin, there's a setting under 'Sales channels' for 'Agentic'. If "Allow Shopify to manage for me" is active, Shopify Catalog publishes your inventory to these AI channels.
- The `/llms.txt` and `/robots.txt` files: Your store has a special `robots.txt` file that tells crawlers what they can access. Crucially, as Ploqo and Bristan_FARRE pointed out, it often points to an `llms.txt` file (e.g., `graes.co/llms.txt`). This file declares things like a UCP profile and an MCP endpoint with a `search_catalog` tool. This means AI agents are specifically told to query *that path* for accurate pricing and availability, often passing buyer context (country, currency). If an agent queries without that context, it might get a stale or incomplete answer.
4. Caching and Retrieval Issues
Sometimes, the data itself is correct, but the AI is simply reading an old, cached version of your page. Icey.Lane and Appify_Commerce suggested asking the specific LLM for the exact URL and retrieval date it used, which can help diagnose caching problems.
Your Action Plan: How to Diagnose and Fix 'Out of Stock' Misinformation
Based on the community's collective wisdom, here's a step-by-step guide to ensure AI agents correctly report your product availability:
Step 1: Inspect Your Product Page's Raw HTML (Structured Data Check)
This is your first port of call. You want to see what the AI crawler sees, *before* JavaScript runs.
- Go to your product page in your browser (e.g., `yourstore.com/products/your-product`).
- View the page source: Press
Ctrl+U(Windows/Linux) orCmd+Option+U(Mac). - Search for structured data: Use
Ctrl+ForCmd+Fand search for. This is where your structured data lives. - Locate Product/Offer blocks: Inside these JSON blocks, look for
"@type": "Product"and within that,"offers": { "@type": "Offer" ... }. - Check availability: Confirm that the
"availability"field is set to"https://schema.org/InStock"for your in-stock products. If it says"OutOfStock", that's a problem. - Count Product blocks: Count how many
blocks contain"@type": "Product". If there's more than one, investigate. - Validate JSON (especially if multiple blocks): If you find multiple blocks, or if your availability signal is wrong, copy the content of the problematic JSON block and paste it into an online JSON validator. Look for parsing errors, like unescaped newlines or missing commas. This was the exact issue Bristan_FARRE found for Becky!
Fixing broken JSON: If you find an unescaped newline (like ` `) or other JSON errors, you'll need to locate the Liquid file generating that specific JSON block in your theme (often in `snippets/product-json.liquid`, `sections/product-template.liquid`, or `layout/theme.liquid`) and correct the syntax. If an app is causing it, you might need to adjust app settings or contact their support.
Step 2: Understand Your Shopify Agentic Sales Channels
This is about how Shopify itself publishes your inventory to AI agents.
- Go to your Shopify Admin.
- Navigate to 'Sales channels' (usually in the left sidebar).
- Look for 'Agentic' or similar (it might be under 'Settings' or 'Apps' depending on your setup).
- Review settings for Shopify Catalog: Ensure "Allow Shopify to manage for me" is enabled. This means Shopify is actively feeding your inventory data to these channels. If you've ever turned off "Shopify Catalog access," remember it can take up to 7 days for changes to fully propagate.
Step 3: Check Your `llms.txt` and `robots.txt` Files
These files dictate how AI agents interact with your store.
- Open your browser and type `yourstore.com/robots.txt`.
- Look for lines mentioning 'agents' or 'LLM', especially near the top or bottom. You might see a reference to `User-agent: *` or specific AI agents.
- Then, go to `yourstore.com/llms.txt`. Read what it says. Does it declare a UCP profile and an MCP endpoint with a `search_catalog` tool, as Bristan_FARRE found? This is important because it tells agents *where* to get their stock information.
- Consider buyer context: If your `llms.txt` tells agents to pass buyer country and currency for accurate pricing and availability, ensure the AI assistant you're testing is doing so. An agent querying without this context might get a generic, potentially inaccurate, availability status.
Step 4: Rule Out Inert Theme Wording
As mentioned, the words "Out of stock" in your theme's JavaScript dictionary are generally harmless.
window.variantStrings = { addToCart: "Add to bag", preOrder: "Pre-order", soldOut: "Out of stock", unavailable: "Unavailable" }
Don't spend time trying to remove these; they're essential for your theme to update button text when a variant *does* actually sell out.
By systematically checking these areas – your structured data for errors, your Shopify admin's agentic settings, and the instructions in your `llms.txt` – you should be able to pinpoint why AI chatbots are getting the wrong idea about your inventory. It's a bit of detective work, but ensuring these advanced systems accurately represent your store is becoming increasingly vital for online success!
Keep those products flying off the virtual shelves, and let's make sure the AI knows they're there!