Should Shopify merchants make product variants selectable in the URL for AI shopping agents?

A shopper asks an AI assistant for a black medium shirt. The assistant finds your product page, but the page opens on blue, small.
That is a small mismatch for a person. They can change the selectors.
For an agent working through a browser, it can be the difference between finding the right offer and landing on a page that does not match the request.
The practical answer is yes: make product variants selectable by URL. At a minimum, support Shopify's standard variant URL:
`/products/product-handle?variant=variant-id`
When someone opens that link, your product page should select that variant and show its own price, availability, media and buying state.
This is not mainly about making thousands of new pages. It is about making one product page able to state, clearly and repeatably, which version of the product it is showing.
What a variant URL should do
A product is often not one purchasable thing.
Say your store sells a shirt in three colours and five sizes. A black medium shirt may have a different stock state from a blue small shirt. It may also have different images. The URL should let a link point to the black medium variant, rather than merely to the shirt in general.
Shopify's theme documentation supports deep links using a variant ID:
`/products/shirt?variant=123456789`
On a product page, Shopify exposes the selected item through `product.selected_variant`. The `variant` parameter determines the selected variant. Shopify also uses this structure in a variant's own `url` field.
That gives you a useful test. Open one of these URLs in a private browser window:
`https://your-store.com/products/product-handle?variant=variant-id`
Then check four things:
- The right option values are selected.
- The displayed price belongs to that variant.
- The availability message belongs to that variant.
- The add-to-cart or purchase state belongs to that variant.
If the URL says black medium but the page defaults to blue small, the link exists without doing its job.
Why this matters for agents, and where it does not
Browser-based agents need usable storefront links. A stable URL gives them a way to open a specific offer and verify what it shows.
This matters most when a URL is the route back to the offer.
Shopify's Global Catalog can include external offers from a merchant's own website. For those offers, each variant URL is the only path to view the full listing or buy it. External offers do not have a `checkout_url`, and native checkout eligibility is always false. In that case, a vague product URL leaves the agent without a reliable way to reach the selected version.
Native Shopify products work differently in Shopify's current catalog tools.
An agent can call `get_product` with selected options, such as a colour of Black, and receive the matching variant's ID, price, availability and checkout URL. Shopify's Global Catalog and Storefront Catalog both support product discovery and variant selection through catalog tools.
So URL-selectable variants are not a replacement for structured catalog data. Native Shopify agents do not need to crawl a product-page URL just to identify a variant.
They are still worth doing.
Your product page is used by people, links, browsers and tools outside that structured path. It is also where an agent may send a shopper when it needs more context before purchase.
For native catalog offers, the purchase route may be the variant's `checkout_url`, not the product-page URL. That is another reason to keep the distinction clear:
- A product-page URL should show the exact selected item correctly.
- A checkout URL can take a shopper straight to checkout for that variant.
- Structured catalog tools can identify the variant without depending on either page URL.
Each route has a different job.
Use Shopify's standard variant parameter first
Start with `?variant=`. It is the most direct implementation because Shopify documents it for product pages.
Do not create a separate product page for every colour and size just to get a linkable variant. That adds more pages to maintain and can make the catalogue harder to reason about.
For products with many combinations, Shopify also supports option-value URLs:
`/products/product-handle?option_values=option-value-id-1,option-value-id-2`
Shopify documents this specifically for high-variant products. It lets the product page select option values without requiring a separate page for every combination.
If your storefront uses Hydrogen, Shopify recommends readable option-based parameters such as:
`/products/shirt?Color=Blue&Size=M`
The server should read those parameters and render the matching variant, including when JavaScript is disabled. Shopify's example expects the correct variant and price to render from the URL.
That last part matters. A URL that works only after a browser loads and runs client-side code is weaker than one that renders the selected product state from the start.
Readable URLs are useful, but accuracy comes first
A `variant` ID is not pleasant to read. It is still stable and unambiguous.
Option-based parameters are easier for a person to understand. A link ending in `Color=Blue&Size=M` tells you what it intends to open. But readable parameters need careful handling.
Your theme or Hydrogen route needs to match those values to a real variant. It also needs to handle a bad or incomplete combination without claiming that an unavailable combination can be bought.
For example, if a customer opens a link for a colour and size that no longer exists, do not silently show a different purchasable variant while keeping the old URL. Show the product state honestly, or select a valid state with a clear change in the page and URL.
The simple rule is this: the URL, selected options and purchasable variant should agree.
Check the live store, not only the theme code
We learned this lesson while building Descriva without the permission to write into a merchant's theme.
We chose fewer permissions on purpose. The trade is that a custom `llms.txt` arrives as a template for the merchant to paste. After that, Descriva reads the live URL rather than assuming the paste worked.
Variant links deserve the same treatment.
A theme can contain code that appears to support `?variant=`. An app, custom JavaScript, a cache rule or a product form can still stop the live page from reflecting the selected variant.
Test the public URL after publishing. Do not stop at a successful deployment.
Here is a short check you can run today:
1. Open a product with at least two variants. 2. Choose a variant that differs in price, availability or image. 3. Copy the resulting variant URL, or construct one with `?variant=ID`. 4. Open it in a private window. 5. Turn off JavaScript if your browser tools allow it, especially on a Hydrogen storefront. 6. Confirm the selected options, price, media and purchase state still match.
Also try an unavailable variant if you have one. You want to see an accurate unavailable state, not an active purchase button for a different variant.
Keep attribution parameters intact
Variant URLs can carry Shopify agent-attribution parameters alongside the variant choice. Shopify's promoted-placement documentation shows URLs containing `variant` plus parameters such as `_gsid`, `utm_source=shopify`, `utm_medium=catalog`, `shcgid` and `shclid`.
If your storefront rewrites URLs, strips query parameters or redirects every product URL to a bare product handle, check that it does not discard the variant parameter or attribution parameters you expect to receive.
You do not need to build your own tracking scheme for this. You do need to avoid breaking the parameters Shopify sends.
The useful standard
Make every sellable variant deterministically selectable on the storefront.
For most Shopify themes, that means supporting stable `?variant=variant-id` links. If your storefront supports readable option parameters, use them too, as long as they resolve to the exact variant and render the right state.
Then verify the live result on a real product page. Pick one product today and open a variant link in a private window. If the page does not show the exact version named in the URL, that is a good small fix to make before worrying about more complicated AI shopping work.