Product Create (Multi-Language) API 文档

商品-创建-支持多语言数据

接口信息

  • 接口地址: {your-site-url}/api/skill/product/create-language-product
  • 基础 URL: {your-site-url} 需替换为你自己的独立站 URL 地址,如 https://your-domain.com/apimanager666
  • 请求方式: POST
  • Content-Type: application/json
  • 说明: 此接口用于新增多语言商品

认证

请求头中需要携带 skill-access-token

Header
skill-access-token {your-skill-access-token} (请替换为你自己的 token)

与普通创建接口的区别

此接口与 /api/skill/product/create 参数结构类似,核心区别在于以下字段使用多语言数据格式

字段 普通格式 多语言格式
title string Object(default + languages
sub_title string Object(default + languages
body_html string Object(default + languages
meta_title string Object(default + languages
meta_keywords string Object(default + languages
meta_description string Object(default + languages
options[].name string Object(default + languages
options[].items Array[string] Array[Object],每个元素为 {"default": "...", "languages": {...}}
variants[].option1 string Object(default + languages
variants[].option2 string Object(default + languages
variants[].option3 string Object(default + languages

多语言数据格式

{
    "default": "默认语言文本(英文)",
    "languages": {
        "cn": "简体中文",
        "tw": "繁體中文",
        "it": "Italian text",
        "de": "German text",
        "ja": "日本語"
    }
}
  • default:默认语言文本(必填)
  • languages:其他语言翻译对象,key 为语言代码,value 为翻译文本

请求参数 (Body - JSON)

顶层字段

字段 类型 必填 说明
product Object ✅ 必填 产品主体数据
productattr_info Array 选填 产品属性信息
images Array ✅ 必填 产品图片
videos Array 选填 产品视频列表
addition_group_id string/int 选填 附加分组 ID
variantremark_id string/int 选填 变体备注 ID
groupbuy_id string/int 选填 团购 ID
collection_ids Array[int] 选填 产品对应的专辑 ID 数组(多对多关系)
label_ids Array 选填 角标 ID 数组
options Array 选填 产品规格定义。单规格为空,多规格必填
variants Array ✅ 必填 产品变体(规格)。单规格产品数组只有一个子项
glasses Object 选填 眼镜类商品属性
mergeimages Array 选填 合并图片列表
tags Array 选填 商品 tag 数组

product 字段详表

字段 类型 必填 说明
spu string 选填 产品 SPU
title Object ✅ 必填 产品标题(多语言格式)
sub_title Object 选填 产品副标题(多语言格式)
body_html Object 选填 产品描述 HTML(多语言格式)
handle string 选填 商品 URL handle。不填写则用 title 自动生成
status int 选填 产品状态。1 上架,2 下架。默认上架
type int ✅ 必填 产品规格类型。1 单规格,2 多规格
vendor string 选填 产品厂家/品牌名称
virtual_sales_count int 选填 产品虚拟销量
is_tax int 选填 是否收税。1 收税,2 不收税
payafteruse int 选填 先用后付。1 先用后付商品,2 普通商品
variant_need_image int 选填 规格是否需要图片。1 需要,2 不需要。默认 1
variant_show_image int 选填 前台商城规格显示方式。1 显示文字,2 显示图片,3 使用插件默认配置
variant_need_note int 选填 变体是否需要备注。1 需要,2 不需要
inventory_police int 选填 是否跟踪库存。1 跟踪,2 不跟踪。默认 1
inventory_police_type int 选填 库存策略。1 库存为0允许购买,2 库存为0不允许购买,3 库存为0自动下架。默认 1
meta_is_edit int 选填 SEO 信息是否独立编辑。1 非独立编辑,2 独立编辑
meta_title Object 选填 SEO 标题(多语言格式)
meta_keywords Object 选填 SEO 关键字(多语言格式)
meta_description Object 选填 SEO 描述(多语言格式)
feed_title string 选填 Feed 自定义 title
feed_description string 选填 Feed 自定义 description
translate_type int 选填 翻译类型。1 强制翻译,2 只翻译多语言为空的部分,3 不翻译
source_type int/string 选填 source 类型。1 代表 1688
template_type string 选填 模版装修的 template key
google_product_category int 选填 Google 商品分类 ID
google_product_type_id string 选填 Google 产品类型
description_json Object 选填 JSON 描述内容(模板装修数据)
description_json_status int 选填 描述是否使用 JSON 字段。1 开启,2 关闭
params_json Array 选填 参数 JSON 内容
params_json_status int 选填 参数是否使用 JSON。1 开启,2 关闭
short_description_json Array[Object] 选填 简短描述(JSON 格式数组,支持多语言)。每项含 text(默认文本)和 lang_params(多语言翻译对象)

productattr_info 字段详表

字段 类型 必填 说明
attr_id int ✅ 必填 属性 ID
item_ids Array[int] ✅ 必填 属性值 ID 数组
id string 选填 记录 ID(新增时为空字符串)

images 字段详表

新增时不需要传 id

字段 类型 必填 说明
src string ✅ 必填 产品图片路径
alt string 选填 图片 alt 文本
position int ✅ 必填 图片排序位置,从 1 开始依次递增。标识为 1 的将作为主图
width int 选填 图片宽度(像素)
height int 选填 图片高度(像素)
ratio string 选填 宽高比
key float 选填 前端唯一标识 key

videos 字段详表

新增时不需要传 id

字段 类型 必填 说明
src string ✅ 必填 视频 URL 路径
alt string 选填 视频 alt 文本
position int ✅ 必填 排序位置
key float 选填 前端唯一标识 key

options 字段详表

单规格产品为空,多规格产品必填。新增时不需要传 id

字段 类型 必填 说明
name Object ✅ 必填 规格名称(多语言格式)
position int ✅ 必填 规格排序,值只能为 123 中的一个,且每个 option 的 position 不可重复
items Array[Object] ✅ 必填 规格子项数组,每个子项为多语言格式 {"default": "...", "languages": {...}}

variants 字段详表

单规格产品数组只有一个子项。新增时不需要传 id

字段 类型 必填 说明
price float ✅ 必填 售卖价格
qty int ✅ 必填 变体库存,默认 0
weight string ✅ 必填 变体重量
weight_unit string ✅ 必填 重量单位。可选值:g(克)、kg(千克)、lb(磅)、oz(盎司)
option1 Object 选填 规格值 1(多语言格式)。其 default 值必须存在于 optionsposition=1 所在行的 items 数组中
option2 Object 选填 规格值 2(多语言格式)。其 default 值必须存在于 optionsposition=2 所在行的 items 数组中
option3 Object 选填 规格值 3(多语言格式)。其 default 值必须存在于 optionsposition=3 所在行的 items 数组中
cost_price float 选填 成本价格
compare_at_price float 选填 划线价格
wholesale_price Array[Object] 选填 批发价格。每项含 qty(批发个数,int)和 price(批发价格,float)
sku string ✅/选填 产品 SKU。根据配置项决定必填唯一、选填唯一或选填非唯一
barcode string 选填 条形码
image string 选填 变体图片路径。注意:此图片必须存在于 images 数组中,否则无法保存
note string 选填 变体备注
buy_min_count int 选填 最小起购数量
customervip Array[Object] 选填 VIP 会员价格。每项含 customervip_id(VIP等级ID,int)和 price(VIP价格,float)
images Array 选填 变体图片列表

tags 字段详表

新增时传 id: ""(空字符串)。

字段 类型 必填 说明
id string 选填 Tag ID(新增时传空字符串 ""
title string 选填 Tag 标题

glasses 字段详表

字段 类型 必填 说明
button_type int 选填 按钮类型
distance_min string 选填 最小距离
distance_max string 选填 最大距离
sex Object 选填 适用性别。含 value(默认值)和 language(多语言对象,如 {"cn": "性别"}
lens_type Object 选填 镜片类型。含 value(默认值)和 language(多语言对象)
material Object 选填 材质。含 value(默认值)和 language(多语言对象)

mergeimages 字段详表

字段 类型 必填 说明
src string ✅ 必填 图片路径
position int ✅ 必填 图片位置排序
alt string 选填 图片 alt 文字
width int 选填 图片宽度(像素)
height int 选填 图片高度(像素)
ratio string 选填 宽高比

请求示例

cURL

curl --location --request POST '{your-site-url}/api/skill/product/create-language-product' \
--header 'skill-access-token: {your-skill-access-token}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "product": {
        "spu": "3232323",
        "title": {
            "default": "Cartoon Bear Printing Women'\''s Cardigan Pajamas Short Sleeve Shorts Household Clothing Suit",
            "languages": {
                "it": "Pigiama da Donna con Stampa Orsetto Cartoon, Cardigan con Maniche Corte e Pantaloncini per Casa",
                "tw": "卡通小熊印花女士開襟睡衣 短袖短褲居家套裝",
                "de": "Damen Pyjama Set mit Cartoon-Bärenprint – Kurzarm Cardigan und Shorts Hausanzug",
                "ja": "漫画風ベアプリント レディースカーディガンパジャマ 半袖&ショートパンツ ルームウェアセット",
                "cn": "卡通小熊印花女士开襟睡衣套装 短袖短裤居家 服"
            }
        },
        "sub_title": {
            "default": "Cute bear print loungewear set...",
            "languages": {
                "it": "Set loungewear con graziosa stampa di orsetti...",
                "tw": "可愛小熊印花居家服套裝...",
                "de": "Niedliches Loungewear-Set mit Bärenprint...",
                "ja": "通気性の良い半袖カーディガン...",
                "cn": "可爱小熊印花居家服套装..."
            }
        },
        "body_html": {
            "default": "<p>Stay comfortable and stylish...</p>",
            "languages": {
                "it": "<p>Rimani comoda e alla moda...</p>",
                "tw": "<p>這款女士睡衣套裝...</p>",
                "de": "<p>Genießen Sie Komfort...</p>",
                "ja": "<p>可愛い漫画風ベアプリント...</p>",
                "cn": "<p>这款女士睡衣套装...</p>"
            }
        },
        "status": 1,
        "is_tax": 1,
        "payafteruse": 1,
        "virtual_sales_count": "33",
        "type": 2,
        "vendor": "Lighting Made",
        "variant_need_image": "1",
        "variant_show_image": 3,
        "inventory_police": "1",
        "inventory_police_type": 1,
        "meta_is_edit": "2",
        "meta_title": {
            "default": "Women'\''s Cartoon Bear Cardigan Pajama Set...",
            "languages": {
                "it": "Pigiama Donna Orsetto Cartoon...",
                "tw": "女士卡通小熊開襟睡衣套裝...",
                "de": "Damen Cartoon-Bären Pyjama Set...",
                "ja": "レディース ベアプリント パジャマセット...",
                "cn": "女士卡通小熊开襟睡衣套装..."
            }
        },
        "meta_keywords": {
            "default": "women pajamas, bear print pajama...",
            "languages": {
                "it": "pigiama donna, stampa orsetto...",
                "tw": "女士睡衣, 小熊印花睡衣...",
                "de": "Damen Pyjama, Bärenprint...",
                "ja": "レディースパジャマ, ベアプリント...",
                "cn": "女士睡衣, 小熊印花睡衣..."
            }
        },
        "meta_description": {
            "default": "Shop this cute women'\''s cartoon bear pajama set...",
            "languages": {
                "it": "Acquista questo grazioso pigiama...",
                "tw": "選購這款可愛女士卡通小熊睡衣套裝...",
                "de": "Entdecken Sie dieses niedliche Damen-Pyjama-Set...",
                "ja": "通気性の良い半袖カーディガン...",
                "cn": "选购这款可爱女士卡通小熊睡衣套装..."
            }
        },
        "feed_description": "google feed description",
        "feed_title": "google feed title",
        "handle": "cartoon-bear-printing-women-cardigan-pajamas-short-sleeve-shorts",
        "translate_type": 3,
        "google_product_category": 111,
        "google_product_type_id": "light",
        "description_json": "",
        "description_json_status": 2,
        "params_json": [],
        "params_json_status": 2,
        "short_description_json": [],
        "template_type": "product",
        "variant_need_note": "1"
    },
    "productattr_info": [],
    "images": [
        {
            "src": "/product/15/image/2026/04/28/3fb5620f4acf97bdf9d056a6220b87e0.jpg",
            "position": 1,
            "alt": "",
            "width": 600,
            "height": 600,
            "ratio": "1.00"
        },
        {
            "src": "/product/15/image/2026/04/28/f6d04b41c743455948ed5dfea357a53e.jpg",
            "position": 2,
            "alt": "",
            "width": 600,
            "height": 600,
            "ratio": "1.00"
        },
        {
            "src": "/product/15/image/2026/04/28/858278fe4f6d493ece46810169a4df21.jpg",
            "position": 3,
            "alt": "",
            "width": 600,
            "height": 600,
            "ratio": "1.00"
        }
    ],
    "videos": [
        {
            "src": "https://cloud.video.taobao.com/play/u/2206786293671/p/1/e/6/t/1/453995116363.mp4",
            "position": 1,
            "alt": ""
        }
    ],
    "addition_group_id": 73,
    "variantremark_id": 9,
    "groupbuy_id": 12,
    "collection_ids": [342, 343],
    "label_ids": [],
    "options": [
        {
            "name": {
                "default": "Color",
                "languages": {
                    "it": "Colore",
                    "tw": "顏色",
                    "de": "Farbe",
                    "cn": "颜色",
                    "ja": "カラー"
                }
            },
            "position": 1,
            "items": [
                {
                    "default": "grey",
                    "languages": {
                        "it": "grigio",
                        "tw": "灰色",
                        "cn": "灰色",
                        "de": "grau",
                        "ja": "グレー"
                    }
                },
                {
                    "default": "white",
                    "languages": {
                        "it": "bianco",
                        "tw": "白色",
                        "cn": "白色",
                        "de": "weiß",
                        "ja": "ホワイト"
                    }
                }
            ]
        },
        {
            "name": {
                "default": "Size",
                "languages": {
                    "it": "Taglia",
                    "tw": "尺寸",
                    "cn": "尺寸",
                    "de": "Größe",
                    "ja": "サイズ"
                }
            },
            "position": 2,
            "items": [
                {
                    "default": "L",
                    "languages": {
                        "it": "L-it",
                        "tw": "L-tw",
                        "de": "L-de",
                        "cn": "L-cn",
                        "ja": "L-ja"
                    }
                },
                {
                    "default": "M",
                    "languages": {
                        "it": "M-it",
                        "tw": "M-tw",
                        "de": "M-de",
                        "cn": "M-cn",
                        "ja": "M-ja"
                    }
                }
            ]
        }
    ],
    "variants": [
        {
            "price": "59.99",
            "compare_at_price": "69.99",
            "cost_price": "29.99",
            "sku": "3232323-grey-L-1010805",
            "barcode": "1111",
            "image": "/product/15/image/2026/04/28/3fb5620f4acf97bdf9d056a6220b87e0.jpg",
            "qty": 8999,
            "option1": {
                "default": "grey",
                "languages": {
                    "it": "grigio",
                    "tw": "灰色",
                    "cn": "灰色",
                    "de": "grau",
                    "ja": "グレー"
                }
            },
            "option2": {
                "default": "L",
                "languages": {
                    "it": "L-it",
                    "tw": "L-tw",
                    "de": "L-de",
                    "cn": "L-cn",
                    "ja": "L-ja"
                }
            },
            "option3": "",
            "weight": "11",
            "weight_unit": "kg",
            "note": "grey l",
            "buy_min_count": 1,
            "wholesale_price": [
                {"qty": 2, "price": "45.88"},
                {"qty": 5, "price": "41.88"}
            ],
            "customervip": [
                {"customervip_id": 11, "price": 44},
                {"customervip_id": 10, "price": 45},
                {"customervip_id": 8, "price": 46},
                {"customervip_id": 7, "price": 47}
            ]
        },
        {
            "price": "59.99",
            "compare_at_price": "69.99",
            "cost_price": "29.99",
            "sku": "3232323-grey-M-1010806",
            "barcode": "2222",
            "image": "/product/15/image/2026/04/28/3fb5620f4acf97bdf9d056a6220b87e0.jpg",
            "qty": 8999,
            "option1": {
                "default": "grey",
                "languages": {
                    "it": "grigio",
                    "tw": "灰色",
                    "cn": "灰色",
                    "de": "grau",
                    "ja": "グレー"
                }
            },
            "option2": {
                "default": "M",
                "languages": {
                    "it": "M-it",
                    "tw": "M-tw",
                    "de": "M-de",
                    "cn": "M-cn",
                    "ja": "M-ja"
                }
            },
            "option3": "",
            "weight": "11",
            "weight_unit": "kg",
            "note": "grey m",
            "buy_min_count": 1,
            "wholesale_price": [
                {"qty": 2, "price": "45.88"},
                {"qty": 5, "price": "41.88"}
            ],
            "customervip": [
                {"customervip_id": 11, "price": 44},
                {"customervip_id": 10, "price": 45},
                {"customervip_id": 8, "price": 46},
                {"customervip_id": 7, "price": 47}
            ]
        },
        {
            "price": "59.99",
            "compare_at_price": "69.99",
            "cost_price": "29.99",
            "sku": "3232323-white-L-1010807",
            "barcode": "3333",
            "image": "/product/15/image/2026/04/28/858278fe4f6d493ece46810169a4df21.jpg",
            "qty": 8999,
            "option1": {
                "default": "white",
                "languages": {
                    "it": "bianco",
                    "tw": "白色",
                    "cn": "白色",
                    "de": "weiß",
                    "ja": "ホワイト"
                }
            },
            "option2": {
                "default": "L",
                "languages": {
                    "it": "L-it",
                    "tw": "L-tw",
                    "de": "L-de",
                    "cn": "L-cn",
                    "ja": "L-ja"
                }
            },
            "option3": "",
            "weight": "11",
            "weight_unit": "kg",
            "note": "white l",
            "buy_min_count": 1,
            "wholesale_price": [
                {"qty": 2, "price": "45.88"},
                {"qty": 5, "price": "41.88"}
            ],
            "customervip": [
                {"customervip_id": 11, "price": 44},
                {"customervip_id": 10, "price": 45},
                {"customervip_id": 8, "price": 46},
                {"customervip_id": 7, "price": 47}
            ]
        },
        {
            "price": "59.99",
            "compare_at_price": "69.99",
            "cost_price": "29.99",
            "sku": "3232323-white-M-1010808",
            "barcode": "4444",
            "image": "/product/15/image/2026/04/28/858278fe4f6d493ece46810169a4df21.jpg",
            "qty": 8999,
            "option1": {
                "default": "white",
                "languages": {
                    "it": "bianco",
                    "tw": "白色",
                    "cn": "白色",
                    "de": "weiß",
                    "ja": "ホワイト"
                }
            },
            "option2": {
                "default": "M",
                "languages": {
                    "it": "M-it",
                    "tw": "M-tw",
                    "de": "M-de",
                    "cn": "M-cn",
                    "ja": "M-ja"
                }
            },
            "option3": "",
            "weight": "11",
            "weight_unit": "kg",
            "note": "white m",
            "buy_min_count": 1,
            "wholesale_price": [
                {"qty": 2, "price": "45.88"},
                {"qty": 5, "price": "41.88"}
            ],
            "customervip": [
                {"customervip_id": 11, "price": 44},
                {"customervip_id": 10, "price": 45},
                {"customervip_id": 8, "price": 46},
                {"customervip_id": 7, "price": 47}
            ]
        }
    ],
    "glasses": {
        "button_type": 1,
        "distance_min": "11",
        "distance_max": "99",
        "sex": {"value": "sex", "language": {"cn": "性别"}},
        "lens_type": {"value": "style", "language": {"cn": "类型"}},
        "material": {"value": "type", "language": {"cn": "材料"}}
    },
    "mergeimages": [],
    "tags": [
        {"title": "white", "id": ""},
        {"title": "black", "id": ""}
    ]
}'

返回结果

code200 表示调用成功;code 不为 200 表示调用失败。

成功响应

{
    "code": 200,
    "data": {
        "product_id": 4693
    },
    "message": "success"
}

返回字段说明

字段 类型 说明
code Number 状态码,200 表示成功
message String 执行结果的文字描述
data.product_id int 创建成功后返回的新产品 ID

错误码说明

错误码 说明
100701003 商品id为空
100701001 商品保存报错
其他错误码 商品保存报错

注意事项

  1. 多语言字段格式为 {"default": "默认文本", "languages": {"语言代码": "翻译文本"}}
  2. default 为必填,languages 为可选(可传空对象 {}
  3. options[].nameoptions[].items 中的每个子项均为多语言格式
  4. variants[].option1/2/3default 值必须与对应 positionoptions[].items 中某个子项的 default 值匹配
  5. 如果 option1/2/3 不涉及多语言翻译,可直接传空字符串 ""
  6. 变体的 image 字段必须已存在于 images 数组中,否则无法保存
  7. images[].position 必须从 1 开始连续递增,position=1 的图片为主图
  8. options[].position 只能为 123,且每个 option 的 position 不可重复
  9. wholesale_price 为变体的批发价格数组,每个元素包含 qty(起批数量)和 price(批发单价)
  10. weight_unit 支持 gkglboz 四种单位
  11. 新增时所有实体的 id 字段均不需要传(或传空),系统会自动生成
Copyright © fecify.com 2025 all right reserved,powered by Gitbook该文件修订时间: 2026-05-07 18:34:46

results matching ""

    No results matching ""