Acciones nativas de Shopify - Productos
En esta sección, hablaremos sobre las acciones relacionadas con "Products & Collection". OneChat admite las siguientes acciones relacionadas con clientes:
- Buscar productos
- Obtener información del producto
- Obtener imágenes del producto
- Obtener variantes del producto
- Buscar colecciones personalizadas
- Buscar colecciones inteligentes
- Obtener información de la colección
- Obtener productos de la colección
Ahora, revisemos estas acciones una por una.
Obtener productos
Esta acción se utiliza para mostrar los productos disponibles en tu tienda Shopify usando varios parámetros como ID del producto, título, proveedor, etc.
Entrada
Payload de respuesta
| {
"products": [
{
"id": 1413101355074,
"title": "2 in 1 Gold MacBook Riser & Stand",
"body_html": "Model Number: For Tablet PC StandMaterial: MetalFeature: Tablet Holder Mount for iPad & phone &TabletModel number: For Macbook Pro 13 15Material: Aluminum alloytablet stands: For Macbook Retina 12 13 15Stand for Tablet: For Ipad mini 1 2 3 4 ",
"vendor": "hapans",
"product_type": "Electronics",
"handle": "2-in-1-gold-macbook-riser-stand",
"variants": [
{
"id": 12535571218498,
"product_id": 1413101355074,
"title": "silver",
"price": "47.99",
"sku": "9877410-silver",
"position": 1,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "silver",
"option2": null,
"option3": null,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2022-10-13T02:39:56-04:00",
"taxable": false,
"barcode": null,
"grams": 0,
"image_id": 3736679678018,
"weight": 0,
"weight_unit": "kg",
"inventory_item_id": 12660409401410,
"inventory_quantity": 989,
"old_inventory_quantity": 989,
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/12535571218498"
},
{
"id": 12535571251266,
"product_id": 1413101355074,
"title": "gold",
"price": "47.99",
"sku": "9877410-gold",
"position": 2,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "gold",
"option2": null,
"option3": null,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2022-09-09T13:26:56-04:00",
"taxable": false,
"barcode": null,
"grams": 0,
"image_id": 3736679678018,
"weight": 0,
"weight_unit": "kg",
"inventory_item_id": 12660409434178,
"inventory_quantity": 998,
"old_inventory_quantity": 998,
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/12535571251266"
},
{
"id": 12535571284034,
"product_id": 1413101355074,
"title": "rose gold",
"price": "47.99",
"sku": "9877410-rose-gold",
"position": 3,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "rose gold",
"option2": null,
"option3": null,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2018-09-12T00:53:05-04:00",
"taxable": false,
"barcode": null,
"grams": 0,
"image_id": 3736679710786,
"weight": 0,
"weight_unit": "kg",
"inventory_item_id": 12660409466946,
"inventory_quantity": 999,
"old_inventory_quantity": 999,
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/12535571284034"
}
],
"options": [
{
"id": 1864082522178,
"product_id": 1413101355074,
"name": "Color",
"position": 1,
"values": [
"silver",
"gold",
"rose gold"
]
}
],
"images": [
{
"id": 3736679645250,
"product_id": 1413101355074,
"position": 1,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 800,
"height": 800,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/macbook_stand.png?v=1571715576",
"variant_ids": [
],
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679645250"
},
{
"id": 3736679678018,
"product_id": 1413101355074,
"position": 2,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 640,
"height": 640,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004687.jpg?v=1571715576",
"variant_ids": [
12535571218498,
12535571251266
],
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679678018"
},
{
"id": 3736679710786,
"product_id": 1413101355074,
"position": 3,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 640,
"height": 640,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004689.jpg?v=1571715576",
"variant_ids": [
12535571284034
],
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679710786"
},
{
"id": 3736679743554,
"product_id": 1413101355074,
"position": 4,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 800,
"height": 800,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004701.jpg?v=1571715576",
"variant_ids": [...], // 0 items
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679743554"
},
{
"id": 3736679776322,
"product_id": 1413101355074,
"position": 5,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 800,
"height": 632,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004699.jpg?v=1571715576",
"variant_ids": [...], // 0 items
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679776322"
}
],
"image": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/macbook_stand.png?v=1571715576"
}
]
} |
Obtener información del producto
Esta acción se utiliza para mostrar información sobre un producto en particular usando su ID de producto.
Entrada
Payload de respuesta
| {
"product": {
"id": 1413101355074,
"title": "2 in 1 Gold MacBook Riser & Stand",
"body_html": "Model Number: For Tablet PC StandMaterial: MetalFeature: Tablet Holder Mount for iPad & phone &TabletModel number: For Macbook Pro 13 15Material: Aluminum alloytablet stands: For Macbook Retina 12 13 15Stand for Tablet: For Ipad mini 1 2 3 4 ",
"vendor": "hapans",
"product_type": "Electronics",
"handle": "2-in-1-gold-macbook-riser-stand",
"variants": [
{
"id": 12535571218498,
"product_id": 1413101355074,
"title": "silver",
"price": "47.99",
"sku": "9877410-silver",
"position": 1,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "silver",
"option2": null,
"option3": null,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2022-10-13T02:39:56-04:00",
"taxable": false,
"barcode": null,
"grams": 0,
"image_id": 3736679678018,
"weight": 0,
"weight_unit": "kg",
"inventory_item_id": 12660409401410,
"inventory_quantity": 989,
"old_inventory_quantity": 989,
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/12535571218498",
"image": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004687.jpg?v=1571715576"
},
{
"id": 12535571251266,
"product_id": 1413101355074,
"title": "gold",
"price": "47.99",
"sku": "9877410-gold",
"position": 2,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "gold",
"option2": null,
"option3": null,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2022-09-09T13:26:56-04:00",
"taxable": false,
"barcode": null,
"grams": 0,
"image_id": 3736679678018,
"weight": 0,
"weight_unit": "kg",
"inventory_item_id": 12660409434178,
"inventory_quantity": 998,
"old_inventory_quantity": 998,
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/12535571251266",
"image": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004687.jpg?v=1571715576"
},
{
"id": 12535571284034,
"product_id": 1413101355074,
"title": "rose gold",
"price": "47.99",
"sku": "9877410-rose-gold",
"position": 3,
"inventory_policy": "deny",
"compare_at_price": null,
"fulfillment_service": "manual",
"inventory_management": "shopify",
"option1": "rose gold",
"option2": null,
"option3": null,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2018-09-12T00:53:05-04:00",
"taxable": false,
"barcode": null,
"grams": 0,
"image_id": 3736679710786,
"weight": 0,
"weight_unit": "kg",
"inventory_item_id": 12660409466946,
"inventory_quantity": 999,
"old_inventory_quantity": 999,
"requires_shipping": true,
"admin_graphql_api_id": "gid://shopify/ProductVariant/12535571284034",
"image": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004689.jpg?v=1571715576"
}
],
"options": [
{
"id": 1864082522178,
"product_id": 1413101355074,
"name": "Color",
"position": 1,
"values": [
"silver",
"gold",
"rose gold"
]
}
],
"images": [
{
"id": 3736679645250,
"product_id": 1413101355074,
"position": 1,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 800,
"height": 800,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/macbook_stand.png?v=1571715576",
"variant_ids": [
],
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679645250"
},
{
"id": 3736679678018,
"product_id": 1413101355074,
"position": 2,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 640,
"height": 640,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004687.jpg?v=1571715576",
"variant_ids": [
12535571218498,
12535571251266
],
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679678018"
},
{
"id": 3736679710786,
"product_id": 1413101355074,
"position": 3,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 640,
"height": 640,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004689.jpg?v=1571715576",
"variant_ids": [
12535571284034
],
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679710786"
},
{
"id": 3736679743554,
"product_id": 1413101355074,
"position": 4,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 800,
"height": 800,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004701.jpg?v=1571715576",
"variant_ids": [...], // 0 items
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679743554"
},
{
"id": 3736679776322,
"product_id": 1413101355074,
"position": 5,
"created_at": "2018-06-18T08:20:46-04:00",
"updated_at": "2019-10-21T23:39:36-04:00",
"alt": null,
"width": 800,
"height": 632,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004699.jpg?v=1571715576",
"variant_ids": [
],
"admin_graphql_api_id": "gid://shopify/ProductImage/3736679776322"
}
],
"image": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/macbook_stand.png?v=1571715576"
}
} |
Obtener imágenes del producto
Esta acción se utiliza para recuperar imágenes del producto y sus variantes usando los IDs de producto.
Entrada
Payload de respuesta
| {
"images": [
{
"id": 3736679645250,
"product_id": 1413101355074,
"position": 1,
"width": 800,
"height": 800,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/macbook_stand.png?v=1571715576"
},
{
"id": 3736679678018,
"product_id": 1413101355074,
"position": 2,
"width": 640,
"height": 640,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004687.jpg?v=1571715576"
},
{
"id": 3736679710786,
"product_id": 1413101355074,
"position": 3,
"width": 640,
"height": 640,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004689.jpg?v=1571715576"
},
{
"id": 3736679743554,
"product_id": 1413101355074,
"position": 4,
"width": 800,
"height": 800,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004701.jpg?v=1571715576"
},
{
"id": 3736679776322,
"product_id": 1413101355074,
"position": 5,
"width": 800,
"height": 632,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/product-image-421004699.jpg?v=1571715576"
}
]
} |
Obtener variantes del producto
Esta acción se utiliza para mostrar información sobre las variantes de un producto usando su ID de producto.
Entrada
Payload de respuesta
| {
"variants": [
{
"id": 12535571218498,
"product_id": 1413101355074,
"title": "silver",
"price": "47.99",
"sku": "9877410-silver",
"position": 1,
"compare_at_price": null,
"option1": "silver",
"option2": null,
"option3": null,
"barcode": null,
"grams": 0,
"image_id": 3736679678018,
"weight": 0,
"weight_unit": "kg",
"inventory_quantity": 989
}
]
} |
Buscar colecciones personalizadas
Esta acción se utiliza para buscar colecciones personalizadas disponibles para tus productos en tu tienda Shopify.
Entrada
Payload de respuesta
| {
"custom_collections": [
{
"id": 34403156034,
"handle": "frontpage",
"title": "Best Selling Products",
"body_html": "<p>Here is our Best selling products.</p> <p>The tips & tricks will power your Shopify store with MUCH More AWESOME data!</p>",
"sort_order": "best-selling",
"image": {
"created_at": "2022-08-17T00:24:01-04:00",
"alt": null,
"width": 900,
"height": 900,
}
}
]
} |
Buscar colecciones inteligentes
Esta acción se utiliza para mostrar las colecciones inteligentes de los productos que tienes en tus tiendas Shopify.
Entrada
Payload de respuesta
| {
"smart_collections": [
{
"id": 264802598978,
"handle": "backpack-collection",
"title": "Backpack collection",
"body_html": "get your backpack and start enjoying your life outdoors!",
"sort_order": "best-selling",
"rules": [
{
"column": "tag",
"relation": "equals",
"condition": "backpack"
}
],
"image": {
"created_at": "2022-08-17T00:23:00-04:00",
"alt": null,
"width": 900,
"height": 900,
}
},
{
"id": 264802631746,
"handle": "electronics",
"title": "Electronics",
"body_html": "Looks for the digital gadget you can't live out with. more information here.",
"sort_order": "best-selling",
"rules": [
{
"column": "tag",
"relation": "equals",
"condition": "Electronics"
}
],
"image": {
"created_at": "2022-08-17T00:21:47-04:00",
"alt": null,
"width": 900,
"height": 900,
}
}
]
} |
Obtener información de la colección
Esta acción se utiliza para mostrar información sobre una colección usando su ID de colección.
Entrada
Payload de respuesta
| {
"collection": {
"id": 264802598978,
"handle": "backpack-collection",
"title": "Backpack collection",
"updated_at": "2023-02-25T07:42:25-05:00",
"body_html": "get your backpack and start enjoying your life outdoors!",
"published_at": "2022-07-28T21:07:11-04:00",
"sort_order": "best-selling",
"template_suffix": "",
"products_count": 7,
"disjunctive": false,
"collection_type": "smart",
"rules": [
{
"column": "tag",
"relation": "equals",
"condition": "backpack"
}
],
"published_scope": "web",
"admin_graphql_api_id": "gid://shopify/Collection/264802598978",
"image": {
"created_at": "2022-08-17T00:23:00-04:00",
"alt": null,
"width": 900,
"height": 900,
}
}
} |
Obtener productos de la colección
Esta acción se utiliza para recuperar productos relacionados con una colección en particular usando el ID de la colección.
Entrada
Payload de respuesta
| {
"products": [
{
"id": 1413104205890,
"title": "Mochila Backpack",
"body_html": " ★LOTS OF STORAGE SPACE&POCKETS: One separate laptop compartment hold 15.6 Inch Laptop as well as 15 Inch,14 Inch and 13 Inch Macbook/Laptop. One spacious packing compartment roomy for daily necessities,tech electronics accessories. Front compartment with many pockets, pen pockets and key fob hook, make your items organized and easier to find ★COMFY&STURDY: Comfortable airflow back design with thick but soft multi-panel ventilated padding, gives you maximum back support. Breathable and adjustable shoulder straps relieve the stress of shoulder. Foam padded top handle for a long time carry on ★FUNCTIONAL&SAFE: A luggage strap allows backpack fit on luggage/suitcase, slide over the luggage upright handle tube for easier carrying. With a hidden anti theft pocket on the back protect your valuable items from thieves. Well made for international airplane travel and day trip ★USB PORT DESIGN: With built in USB charger outside and built in charging cable inside,this usb backpack offers you a more convenient way to charge your phone while walking. Please noted that this backpack doesn't power itself, usb charging port only offers an easy access to charge ★DURABLE MATERIAL&SOLID: Made of Water Resistant and Durable Polyester Fabric with metal zippers.Ensure a secure & long-lasting usage everyday & weekend.Serve you well as professional office work bag,slim USB charging bagpack,college high school big student backpack for boys,girls,teens,adults ",
"vendor": "hapans",
"product_type": "backpack",
"handle": "mochila-backpack",
"options": [
{
"id": 1864085733442,
"product_id": 1413104205890,
"name": "Color",
"position": 1
},
{
"id": 1864085766210,
"product_id": 1413104205890,
"name": "Size",
"position": 2
}
],
"images": [
{
"id": 3736686919746,
"product_id": 1413104205890,
"position": 1,
"created_at": "2018-06-18T08:22:39-04:00",
"updated_at": "2019-10-21T23:39:37-04:00",
"alt": null,
"width": 800,
"height": 800,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/Mochila_Backpack.png?v=1571715577",
"variant_ids": [
12535580164162
],
"admin_graphql_api_id": "gid://shopify/ProductImage/3736686919746"
},
{
"id": 3736686952514,
"product_id": 1413104205890,
"position": 2,
"created_at": "2018-06-18T08:22:39-04:00",
"updated_at": "2019-10-21T23:39:37-04:00",
"alt": null,
"width": 430,
"height": 430,
"src": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/Backpack_black.png?v=1571715577",
"variant_ids": [...], // 1 items
"admin_graphql_api_id": "gid://shopify/ProductImage/3736686952514"
}
],
"image": "https://cdn.shopify.com/s/files/1/0017/6367/2130/products/Mochila_Backpack.png?v=1571715577"
}
]
} |