Shopify批量上传:自动化产品导入 - Openclaw Skills

作者:互联网

2026-04-12

AI教程

什么是 Shopify批量上传工具?

Shopify批量上传工具是专为使用Openclaw Skills的开发人员和商家设计的专业级同步工具。该工具弥补了结构化电子表格数据与Shopify Admin API之间的差距,允许快速创建和管理复杂的产品目录。它处理API身份验证、图像处理和变体映射等繁重工作,确保您的店铺数据保持一致和最新。

通过将此工具集成到您的工作流中,Openclaw Skills使您能够绕过手动数据录入的限制。无论您是发布新系列还是管理数千个SKU,此技能都能提供企业级电子商务运营所需的可靠性和技术深度。

下载入口:https://github.com/openclaw/skills/tree/main/skills/zhaoteng-qd/shopify-bulk-upload

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install shopify-bulk-upload

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 shopify-bulk-upload。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Shopify批量上传工具 应用场景

  • 从制造商提供的电子表格中快速列出新产品系列。
  • 将产品数据从旧的电子商务平台迁移到新的Shopify实例。
  • 对库存水平、定价和产品描述进行批量更新。
  • 自动化上传具有特定属性(如尺寸、颜色和材料)的多变体商品。
Shopify批量上传工具 工作原理
  1. 用户将产品元数据和图像URL整理到标准化的Excel或CSV模板中。
  2. 该技能使用安全的环境变量初始化与Shopify Admin API的连接。
  3. 脚本解析数据文件,验证SKU、标题和价格等必填字段。
  4. 批量创建或更新产品实体,系统自动处理每个项目的媒体上传。
  5. 显示实时进度,并生成详细日志以跟踪成功导入的情况并识别任何错误。

Shopify批量上传工具 配置指南

首先,在项目根目录的.env文件中配置您的API凭据:

SHOPIFY_STORE_URL=https://your-store.myshopify.com
SHOPIFY_ACCESS_TOKEN=your_access_token
SHOPIFY_API_VERSION=2024-01

接下来,安装所需的Python环境依赖项:

cd scripts
pip install -r requirements.txt

最后,执行脚本以启动批量上传过程:

python shopify_bulk_upload.py

Shopify批量上传工具 数据架构与分类体系

该工具要求输入文件具有特定结构,以确保与Shopify的兼容性。以下是Openclaw Skills使用的核心字段:

字段 必填 描述
title 在店面显示的产品名称
sku 产品变体的唯一标识符
price 商品的售价
vendor 品牌或制造商名称
images 以逗号分隔的公共图像URL列表
inventory_quantity 商品的初始库存水平
status 设置为active(活跃)、draft(草稿)或archived(已归档)
name: shopify-bulk-upload
description: Bulk upload products to Shopify stores. Read product data from Excel/CSV, automatically create products, images, variants, prices and inventory. Use cases: (1) Batch list new products (2) Migrate products from other platforms to Shopify (3) Batch update existing product information.

Shopify Bulk Upload Tool

A powerful tool to bulk upload products to your Shopify store from Excel/CSV files.

Features

  • ? Read Excel/CSV product data
  • ? Create products with multiple images
  • ? Support product variants (color, size, etc.)
  • ? Auto image upload processing
  • ? Inventory management
  • ? Error logging and retry
  • ? Incremental update by SKU
  • ? Upload progress display

Quick Start

1. Prepare Product Data File

Prepare product data in assets/products.xlsx or assets/products.csv:

Field Required Description
title ? Product title
description ? Product description (HTML supported)
vendor ? Brand/Supplier
product_type ? Product type
price ? Price
compare_at_price ? Original price (for showing discount)
sku ? SKU code
inventory_quantity ? Stock quantity
weight ? Weight (unit: kg)
weight_unit ? Weight unit: kg, g, lb, oz
status ? active, draft, archived
tags ? Tags (comma separated)
images ? Image URLs (comma separated, multiple)
variant_title ? Variant name (e.g., Color, Size)
option1_name ? Variant option 1 name (e.g., Color)
option1_value ? Variant option 1 value (e.g., Red)
option2_name ? Variant option 2 name (e.g., Size)
option2_value ? Variant option 2 value (e.g., M)

2. Configure Shopify API

Configure in .env file:

SHOPIFY_STORE_URL=https://your-store.myshopify.com
SHOPIFY_ACCESS_TOKEN=your_access_token
SHOPIFY_API_VERSION=2024-01

To get Access Token:

  1. Login to Shopify Admin
  2. Go to Settings → Apps and sales channels → Develop apps
  3. Create App → Configure Admin API scopes
  4. Check write_products, write_inventory permissions
  5. Install app → Get Access Token

3. Install Dependencies

cd scripts
pip install -r requirements.txt

4. Run Upload Script

python shopify_bulk_upload.py

Output Results

After completion:

  • logs/upload.log - Upload log
  • logs/error.log - Error details
  • output/products_created.json - Successfully created products
  • output/products_failed.json - Failed products

Configuration

Edit scripts/config.py to customize:

CONFIG = {
    "batch_size": 10,           # Products per batch
    "retry_count": 3,           # Retry attempts on failure
    "retry_delay": 2,           # Retry interval (seconds)
    "image_timeout": 30,       # Image upload timeout (seconds)
    "default_status": "active" # Default product status
}

Documentation

  • Shopify Admin API: See references/shopify-api.md
  • Template example: See assets/products-template.csv

Requirements

  • Python 3.8+
  • pandas
  • requests
  • python-dotenv
  • openpyxl