Get Shopify Product
{
"intent": "shopify.query.product",
"utterances": [
"tell me about %productname%",
"what is %productname%",
"show me %productname%",
"find %productname%",
"do you have %productname%",
"get %productname%",
"product details for %productname%",
"describe %productname%",
"info on %productname%",
"look up %productname%",
"search for %productname%",
"i am looking for %productname%"
],
"slots": [
"productname"
],
"answer": [
{
"index": 0,
"action": "api",
"instruction": {
"url": "https://YOUR-STORE.myshopify.com/api/2024-10/graphql.json",
"options": {
"method": "post",
"headers": {
"Content-Type": "application/json",
"X-Shopify-Storefront-Access-Token": "YOUR_STOREFRONT_ACCESS_TOKEN"
},
"configurations": "",
"body": {
"query": "query ProductByTitle($q: String!) { products(first: 1, query: $q) { edges { node { id title handle description onlineStoreUrl featuredImage { url } priceRange { minVariantPrice { amount currencyCode } } variants(first: 1) { edges { node { id title availableForSale } } } } } } }",
"variables": {
"q": "title:%productname%"
}
}
}
},
"variables": {
"productname": "EXAMPLE PRODUCT"
},
"selections": [
{
"path": "data.products.edges[0].node.id",
"value": "gid://shopify/Product/1001"
},
{
"path": "data.products.edges[0].node.title",
"value": "EXAMPLE PRODUCT"
},
{
"path": "data.products.edges[0].node.handle",
"value": "example-product"
},
{
"path": "data.products.edges[0].node.description",
"value": "Short product description from Shopify."
},
{
"path": "data.products.edges[0].node.onlineStoreUrl",
"value": "https://YOUR-STORE.myshopify.com/products/example-product"
},
{
"path": "data.products.edges[0].node.featuredImage.url",
"value": "https://cdn.shopify.com/s/files/1/0000/0000/products/example-product.jpg"
},
{
"path": "data.products.edges[0].node.priceRange.minVariantPrice.amount",
"value": "29.99"
},
{
"path": "data.products.edges[0].node.priceRange.minVariantPrice.currencyCode",
"value": "USD"
},
{
"path": "data.products.edges[0].node.variants.edges[0].node.availableForSale",
"value": true
}
]
},
{
"index": 1,
"action": "text",
"instruction": "<div style=\"max-width:400px;margin:0 auto;overflow:hidden;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;\"><div style=\"width:100%;max-height:250px;overflow:hidden;\"><img style=\"width:100%;height:100%;max-height:250px;object-fit:cover;\" src=\"[data.products.edges[0].node.featuredImage.url]\" alt=\"[data.products.edges[0].node.title]\"></div><div style=\"padding:5px;\"><h3 style=\"margin:0 0 8px 0;font-size:14px;font-weight:600;\">[data.products.edges[0].node.title]</h3><div style=\"font-size:24px;font-weight:bold;margin-bottom:8px;\">[data.products.edges[0].node.priceRange.minVariantPrice.currencyCode] [data.products.edges[0].node.priceRange.minVariantPrice.amount]</div><div style=\"font-size:13px;line-height:1.4;margin-bottom:16px;color:#444;\">[data.products.edges[0].node.description]</div><a style=\"display:inline-block;background-color:#000;color:#fff;text-decoration:none;padding:12px 24px;border-radius:6px;font-weight:500;text-align:center;width:100%;box-sizing:border-box;\" href=\"[data.products.edges[0].node.onlineStoreUrl]\" target=\"_blank\" rel=\"noopener\">View Product</a></div></div>"
},
{
"index": 2,
"action": "button",
"raw": [
{
"text": "View product",
"link": "[data.products.edges[0].node.onlineStoreUrl]",
"class": [
"btn",
"btn-block",
"btn-primary"
]
},
{
"text": "Ask about another product",
"link": "",
"class": [
"btn",
"btn-block",
"btn-outline-primary"
]
}
],
"instruction": "<span class=\"button-group\"><button data-url=\"[data.products.edges[0].node.onlineStoreUrl]\" data-text=\"View product\" class=\"btn btn-block btn-primary\">View product</button><button data-text=\"Ask about another product\" class=\"btn btn-block btn-outline-primary\">Ask about another product</button></span>"
}
]
}
Description
A training data to retrieve a product from your shopify store and return it in chat. Placeholders to swap after download/import YOUR-STORE.myshopify.com YOUR_STOREFRONT_ACCESS_TOKEN