Developers · Reference

Your data, in your theme. Metafields and Liquid snippets.

Everything StoreAi works out is saved on your products as storeai.* metafields: badges, sales speed, days of stock, margin and product facts. Use the app's theme blocks, or print them yourself with a few lines of Liquid.

Linen camp shirt JSON-LD
"@type": "Product"
"name": "Linen camp shirt"
"brand": "Field & Fold"
"additionalProperty": [
{ "name": "Material", "value": "100% linen" }
{ "name": "Fit", "value": "Runs large" }
]
"offers": { "price": 64, "availability": "InStock" }
Readable by Google and AI shopping assistants
  • 01Plain metafieldsStandard Shopify types, readable in Liquid, the Storefront API and the Admin API.
  • 02Kept freshSales numbers and badges update on every sort; facts update when you approve changes.
  • 03Only changes are writtenA daily re-sort of 5,000 products writes only the values that moved.

Metafield reference

All fields are on the product owner, namespace storeai. Sales fields need the autopilot merchandiser on for a collection containing the product; facts come from Catalog Studio and Snap to Shelf.

KeyTypeValue
storeai.badgesjsonList of up to two strings, like ["#1 in Hoodies", "Selling fast"]. Empty list when none apply
storeai.velocitynumber_decimalAverage units sold per day over the last 30 days, like 3.47
storeai.trendnumber_decimalLast 7 days' pace divided by the 30-day pace. 1 is steady, above 1 is rising
storeai.days_of_stocknumber_integerDays the current stock lasts at the 30-day pace. 999 when not selling. Absent when stock isn't tracked
storeai.marginnumber_decimal(price − cost) ÷ price, from 0 to 1, like 0.62. Absent without cost per item
storeai.factsjsonList of { "name", "value" } product facts, like Material or Fit

Badges on product pages

The no-code route is the StoreAi badges app block. To place them yourself, for example in sections/main-product.liquid:

snippets/storeai-badges.liquid
{%- comment -%} Render with {% render 'storeai-badges', product: product %} {%- endcomment -%}
{%- assign badges = product.metafields.storeai.badges.value -%}
{%- if badges and badges.size > 0 -%}
  <ul class="storeai-badges" role="list">
    {%- for badge in badges limit: 2 -%}
      <li class="storeai-badge">{{ badge | escape }}</li>
    {%- endfor -%}
  </ul>
{%- endif -%}

Badges on product cards

The StoreAi badges on cards app embed labels cards on collection and search pages automatically. In a theme you control, print the first badge in the card snippet instead. In Dawn and its forks that's snippets/card-product.liquid:

snippets/card-product.liquid
{%- assign storeai_badges = card_product.metafields.storeai.badges.value -%}
{%- if storeai_badges and storeai_badges.size > 0 -%}
  <span class="badge storeai-card-badge">{{ storeai_badges.first | escape }}</span>
{%- endif -%}

Stock and speed messages

Use the numbers for your own honest messages. For example, a low-stock note that only shows when it's true:

snippets/storeai-stock-note.liquid
{%- assign days = product.metafields.storeai.days_of_stock.value -%}
{%- assign speed = product.metafields.storeai.velocity.value -%}
{%- if days and days > 0 and days < 7 -%}
  <p class="stock-note">Selling quickly: at the current pace this sells out in about {{ days }} days.</p>
{%- elsif speed and speed >= 1 -%}
  <p class="stock-note">About {{ speed | times: 7 | round }} sold in a typical week.</p>
{%- endif -%}

Product facts

Print the facts StoreAi keeps as a specification list. The same list feeds the structured data app embed as additionalProperty:

snippets/storeai-facts.liquid
{%- assign facts = product.metafields.storeai.facts.value -%}
{%- if facts and facts.size > 0 -%}
  <dl class="product-facts">
    {%- for fact in facts -%}
      <div>
        <dt>{{ fact.name | escape }}</dt>
        <dd>{{ fact.value | escape }}</dd>
      </div>
    {%- endfor -%}
  </dl>
{%- endif -%}
storeai.facts (example value)
[
  { "name": "Material", "value": "100% European linen" },
  { "name": "Fit", "value": "Runs half a size large" },
  { "name": "Care", "value": "Machine wash cold" }
]

Reading them through the API

The same values are available to headless storefronts and your own tools. With the Admin GraphQL API:

Admin API
query StoreAiFields($id: ID!) {
  product(id: $id) {
    title
    metafields(namespace: "storeai", first: 10) {
      nodes { key type value }
    }
  }
}
To read them with the Storefront API, expose the storeai metafield definitions to the storefront first.

Theme blocks at a glance

BlockTypeWhere
StoreAi badgesApp blockProduct template, any section that accepts app blocks
StoreAi badges on cardsApp embedCollection and search pages; labels cards by their product link
StoreAi structured dataApp embedAdds Product JSON-LD to product pages, merged by @id

Turn app embeds on in the theme editor under App embeds. See storefront badges and AI-ready product data for what each one shows.

Questions

Can I write to the storeai metafields myself?
You can, but StoreAi overwrites sales fields and badges on the next sort. Put your own data in your own namespace.
Are the metafields removed when StoreAi is uninstalled?
App data is deleted when you uninstall. Metafields already on your products stay until you remove them, so your theme won't break; they simply stop updating.

Try it on your own store. Free.

Install free on ShopifyFree plan · No card · Billed by Shopify