# taobao-distributor **Repository Path**: code_87/taobao-distributor ## Basic Information - **Project Name**: taobao-distributor - **Description**: 淘宝分销铺货工具 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2026-06-21 - **Last Updated**: 2026-08-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Taobao Distributor 淘宝分销铺货工具。配置好凭证后,通过命令行接收商品信息,调用淘宝 TOP API 批量铺货。 ## 快速开始 ```bash # 1. 复制并编辑配置 cp config.example.yaml config.yaml # 2. 铺货(从 stdin 读取 JSON) echo '{"title":"测试商品","price":99.00,"stock":100}' | ./distributor publish # 3. 铺货(从文件读取) ./distributor publish --file items.json ``` ## 目录结构 ``` ├── cmd/ # 命令行入口 │ └── main.go ├── config/ # 配置管理 │ └── config.go ├── api/ # 淘宝 TOP API 客户端 │ ├── client.go # 基础客户端(签名、请求) │ ├── publish.go # 商品发布 │ ├── schema.go # Schema 规则获取 │ └── upload.go # 图片上传 ├── model/ # 数据模型 │ └── item.go ├── pkg/ # 工具包 │ └── xml.go # Schema XML 处理 ├── config.yaml # 配置文件(gitignore) ├── config.example.yaml ├── go.mod └── README.md ``` ## 支持的接口 - `alibaba.item.publish.schema.distribute.get` — 获取铺货 Schema - `alibaba.item.publish.distribute.submit` — 提交铺货 - `alibaba.item.operate.upshelf` — 商品上架 - `alibaba.item.operate.downshelf` — 商品下架 - `taobao.tbk.img.qrcode.upload` — 图片上传到淘宝 CDN ## 注意事项 - 需要淘宝开放平台开发者账号(企业账号权限更全) - 分销铺货需开通 `alibaba.item.publish.schema.distribute` 权限 - 图片需先上传到淘宝 CDN 再引用