开放Api-商品-多语言-创建
Api描述:商家端,创建产品,支持多语言商品数据
URL: /manager/api/apps/openapi/product/language-save
格式:json
方式:post
数据请求部分
1.Request Header 参数:
| 参数名称 | 是否必须 | 类型 | 描述 |
|---|---|---|---|
| open-access-token | 必须 | String | 在开放api插件中,创建权限后即可获取该token |
2.Request JSON Data(Body):
| 参数名称 | 是否必须 | 类型 | 描述 |
|---|---|---|---|
| product | 必须 | array | 产品主题数据 |
| product > spu | 选填 | string | 产品spu |
| product > title | 必须 | array | 产品标题 ,必须多语言格式,详细参看json示例 |
| product > sub_title | 选填 | array | 产品副标题,如果没有值可传递空字符串,如果有值则必须多语言格式,详细参看json示例 |
| product > body_html | 必须 | array | 产品描述,必须多语言格式,详细参看json示例 |
| product > meta_title | 选填 | array | 【seo标题】 meta title,如果没有值可传递空字符串,如果有值则必须多语言格式,详细参看json示例 |
| product > meta_keywords | 选填 | array | 【seo关键字】 meta keywords ,如果没有值可传递空字符串,如果有值则必须多语言格式,详细参看json示例 |
| product > meta_description | 选填 | array | 【seo描述】 meta description,如果没有值可传递空字符串,如果有值则必须多语言格式,详细参看json示例 |
| product > handle | 选填 | string | 【seo链接】 产品url path, 如果不填写,则使用title字符串生成 |
| product > status | 选填 | string | 产品状态,1代表上架,2代表下架 ,默认为上架 |
| product > type | 必填 | string | 产品规格类型,1为单规格,2为多规格(规格指的是颜色,尺码等) |
| product > virtual_sales_count | 选填 | int | 产品虚拟销量 |
| product > vendor | 选填 | string | 产品厂家名称(品牌名称) |
| product > variant_need_image | 选填 | int | 产品规格是否需要图片, 1代表需要,2代表不需要 默认为1需要 |
| product > variant_need_note | 选填 | int | 变体是否需要备注,1代表需要备注,2代表不需要备注 |
| product > inventory_police | 选填 | int | 是否跟踪库存,1为跟踪,2为不跟踪,默认为1跟踪库存 |
| product > inventory_police_type | 选填 | int | 1为库存为0,允许购买,2为库存为0不允许购买,3为库存为0,则产品直接下架。(默认为1允许购买) |
| images | 必填 | array | 产品图片 |
| images > src | 必须 | string | 产品图片路径 |
| images > alt | 选填 | string | 图片 alt |
| images > position | 必须 | string | 产品图片位置,按照顺序,从1开始,依次递增(必须从1开始,标识为1的将作为主图) |
| collection_ids | 选填 | array[int] | 产品对应的 专辑ids 数组,一个产品可以对应多个专辑,是多对多关系,因此这里是数组可以,可以传递多个专辑id |
| options | 选填 | array | 单规格为空,多规格必填不为空 |
| options > name | 必须 | array | 规格名称,数组格式,必须多语言格式,详细参看json示例 |
| options > position | 必须 | string | 规格排序 |
| options > items | 必须 | array | 规格子项数组(数组中的每个子项,必须多语言格式,详细参看json示例) |
| variants | 必须 | array | 产品变体(规格) ,当为单规格产品,将属性填写到该部分下面即可(数组只有一个子项) |
| variants > cost_price | 选填 | float | 产品变体-成本价格 |
| variants > price | 必填 | float | 产品变体-售卖价格 |
| variants > compare_at_price | 选填 | float | 产品变体-划线价格 |
| variants > sku | 必须/选填 | string | 产品变sku,根据配置项,来决定必填唯一,选填唯一,选填非唯一 |
| variants > barcode | 选填 | string | 产品变体条形码 |
| variants > image | 选填 | string | 产品变体图片路径(这里填写路径即可,在保存的时候,会到产品图片表里面查找,找到得到image_id,然后赋值。),注意,这里的image,必须在 images参数中存在,否则将无法保存 |
| variants > qty | 必须 | string | 产品变体库存,默认0 |
| variants > option1 | 选填 | array | 产品变体规格1,支持字符串格式和多语言数组格式:1.如果没有值,则填写空字符串,2.可以字符串格式,只填写默认语言的值,3.可以按照多语言格式填写多语言的json数组格式,详细参看下面的json示例 |
| variants > option2 | 选填 | array | 产品变体规格2,支持字符串格式和多语言数组格式:1.如果没有值,则填写空字符串,2.可以字符串格式,只填写默认语言的值,3.可以按照多语言格式填写多语言的json数组格式,详细参看下面的json示例 |
| variants > option3 | 选填 | array | 产品变体规格3,支持字符串格式和多语言数组格式:1.如果没有值,则填写空字符串,2.可以字符串格式,只填写默认语言的值,3.可以按照多语言格式填写多语言的json数组格式,详细参看下面的json示例 |
| variants > weight | 必须 | string | 产品变体重量 |
| variants > weight_unit | 必须 | string | 产品变体重量单位 |
| variants > note | 选填 | string | 产品变体备注 |
| tags | 选填 | array | 商品tag,数组格式,可以填写多个,也可以留空 |
注意,对于图片:
- 如果您想上传图片,请先使用 开放Api-上传图片 同步图片,参数:images.src:使用上传后的图片路径:
"/product/15/image/2023/01/30/5b17ccf2483c46a900f569aac7924c61.jpg" - 如果您想使用网络图片,那么参数:images.src,使用https开头的网络图片即可。(注意,直接使用网络图,请尽量使用webp)
该api,支持多语言商品数据,和开放Api-商品-创建的区别在于,以下几个字段,使用的是多语言数据格式:
- title
- sub_title
- body_html
- meta_title
- meta_keywords
- meta_description
- options.name
- options.items
- variants.option1
- variants.option2
- variants.option3
post示例数据:(创建产品的例子)
{
"product": {
"spu": "xxxxx",
"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 featuring a breathable short-sleeve cardigan top and comfy shorts—perfect for relaxing at home or sleeping in style.",
"languages": {
"it": "Set loungewear con graziosa stampa di orsetti, composto da cardigan traspirante a maniche corte e comodi pantaloncini—ideale per rilassarsi a casa o dormire con stile.",
"tw": "可愛小熊印花居家服套裝,採用透氣短袖開襟上衣與舒適短褲設計,讓您在家放鬆或入睡都時尚自在。",
"de": "Niedliches Loungewear-Set mit Bärenprint, bestehend aus atmungsaktivem Kurzarm-Cardigan und bequemen Shorts – perfekt zum Entspannen oder Schlafen.",
"ja": "通気性の良い半袖カーディガンと快適なショートパンツに可愛いベア柄をあしらった、リラックスタイムに最適なルームウェア。",
"cn": "可爱小熊印花居家服套装,采用透气短袖开襟上衣与舒适短裤设计,让您在家放松或入睡都能保持时尚与舒适。"
}
},
"body_html": {
"default": "<p>Stay comfortable and stylish with this adorable women's pajama set featuring a charming cartoon bear print. Designed for everyday relaxation, this two-piece set includes a lightweight short-sleeve cardigan top and matching shorts that provide the perfect balance of softness and breathability.</p><p>The relaxed fit allows for easy movement, making it ideal for sleeping, lounging, or enjoying a cozy day at home. The button-up cardigan design adds a touch of classic style while ensuring convenience when putting it on or taking it off.</p><ul><li>Soft and breathable fabric for all-night comfort</li><li>Cute cartoon bear print for a playful look</li><li>Short-sleeve cardigan with easy button closure</li><li>Matching shorts with a comfortable fit</li><li>Perfect for sleepwear, loungewear, or casual home wear</li></ul><p>Whether you're unwinding after a long day or enjoying a slow weekend morning, this pajama set brings comfort and charm to your home wardrobe.</p>",
"languages": {
"it": "<p>Rimani comoda e alla moda con questo adorabile set di pigiama da donna con una graziosa stampa di orsetti cartoon. Progettato per il relax quotidiano, questo completo a due pezzi include un cardigan leggero a maniche corte e pantaloncini coordinati che offrono il perfetto equilibrio tra morbidezza e traspirabilità.</p><p>La vestibilità rilassata consente libertà di movimento, rendendolo ideale per dormire, rilassarsi o trascorrere una giornata accogliente a casa. Il design con bottoni aggiunge un tocco classico e pratico.</p><ul><li>Tessuto morbido e traspirante per il massimo comfort</li><li>Stampa di orsetti per uno stile giocoso</li><li>Cardigan a maniche corte con chiusura a bottoni</li><li>Pantaloncini coordinati e confortevoli</li><li>Perfetto come pigiama o abbigliamento da casa</li></ul><p>Perfetto per rilassarti dopo una lunga giornata o per goderti un tranquillo weekend.</p>",
"tw": "<p>這款女士睡衣套裝以可愛的卡通小熊印花為特色,兼具舒適與時尚感。兩件式設計包含輕盈透氣的短袖開襟上衣與同款短褲,帶來柔軟與清爽的穿著體驗。</p><p>寬鬆版型讓活動更加自在,非常適合睡眠、居家休閒或放鬆時穿著。開襟鈕扣設計增添經典風格,同時方便穿脫。</p><ul><li>柔軟透氣布料,整晚舒適</li><li>可愛小熊印花,活潑俏皮</li><li>短袖開襟設計,穿脫方便</li><li>舒適合身的短褲</li><li>適合睡衣、居家服或日常休閒穿著</li></ul><p>無論是結束忙碌一天後的放鬆時刻,還是悠閒的週末早晨,這套睡衣都能為您的居家穿搭增添溫馨與魅力。</p>",
"de": "<p>Genießen Sie Komfort und Stil mit diesem bezaubernden Damen-Pyjama-Set mit niedlichem Cartoon-Bärenprint. Das zweiteilige Set besteht aus einem leichten, atmungsaktiven Kurzarm-Cardigan und passenden Shorts und bietet die perfekte Kombination aus Weichheit und Luftdurchlässigkeit.</p><p>Die lockere Passform sorgt für maximale Bewegungsfreiheit und eignet sich ideal zum Schlafen, Entspannen oder für gemütliche Stunden zu Hause. Das Button-Design verleiht einen klassischen Look und macht das An- und Ausziehen besonders einfach.</p><ul><li>Weiches und atmungsaktives Material</li><li>Niedlicher Bärenprint für einen verspielten Stil</li><li>Kurzarm-Cardigan mit Knopfverschluss</li><li>Bequeme, passende Shorts</li><li>Ideal als Schlafanzug oder Loungewear</li></ul><p>Perfekt, um nach einem langen Tag zu entspannen oder einen ruhigen Morgen zu genießen.</p>",
"ja": "<p>可愛い漫画風ベアプリントが特徴のレディースパジャマセット。軽量で通気性の良い半袖カーディガンとお揃いのショートパンツを組み合わせ、柔らかく快適な着心地を実現しました。</p><p>ゆったりとしたフィット感で動きやすく、就寝時はもちろん、リラックスタイムやおうち時間にも最適です。ボタン付きカーディガンはクラシックな印象で、着脱も簡単です。</p><ul><li>柔らかく通気性の良い素材</li><li>キュートなベアプリント</li><li>ボタン付き半袖カーディガン</li><li>快適なショートパンツ</li><li>パジャマやルームウェアとして最適</li></ul><p>忙しい一日の後のリラックスタイムや、のんびりした週末にぴったりの一着です。</p>",
"cn": "<p>这款女士睡衣套装采用迷人的卡通小熊印花设计,让您在享受舒适穿着的同时依然保持时尚感。两件式套装包含轻盈的短袖开襟上衣和配套短裤,在柔软与透气之间实现理想平衡。</p><p>宽松版型带来自由活动空间,非常适合睡眠、居家休闲或惬意地度过宅家时光。纽扣式开襟设计增添经典气质,同时方便穿脱。</p><ul><li>柔软透气面料,带来整晚舒适体验</li><li>可爱卡通小熊印花,打造俏皮风格</li><li>短袖开襟设计,纽扣闭合更便捷</li><li>配套短裤,穿着舒适合身</li><li>适合作为睡衣、居家服或日常休闲穿搭</li></ul><p>无论是在忙碌一天后放松身心,还是享受慵懒的周末清晨,这套睡衣都能为您的居家衣橱增添舒适与魅力。</p>"
}
},
"meta_title": {
"default": "Women's Cartoon Bear Cardigan Pajama Set Short Sleeve Shorts Loungewear",
"languages": {
"it": "Pigiama Donna Orsetto Cartoon Cardigan Maniche Corte con Pantaloncini",
"tw": "女士卡通小熊開襟睡衣套裝 短袖短褲居家服",
"de": "Damen Cartoon-Bären Pyjama Set Kurzarm mit Shorts",
"ja": "レディース ベアプリント パジャマセット 半袖 カーディガン&ショートパンツ",
"cn": "女士卡通小熊开襟睡衣套装 短袖短裤居家服"
}
},
"meta_keywords": {
"default": "women pajamas, bear print pajama, cardigan sleepwear, shorts pajama set, cute loungewear, summer pajamas",
"languages": {
"it": "pigiama donna, stampa orsetto, pigiama cardigan, set con pantaloncini, abbigliamento casa, pigiama estivo",
"tw": "女士睡衣, 小熊印花睡衣, 開襟睡衣, 短褲睡衣套裝, 可愛居家服, 夏季睡衣",
"de": "Damen Pyjama, Bärenprint Schlafanzug, Cardigan Nachtwäsche, Shorts Pyjama Set, Loungewear Damen, Sommerpyjama",
"ja": "レディースパジャマ, ベアプリント, カーディガンパジャマ, ショートパンツセット, ルームウェア, 夏用パジャマ",
"cn": "女士睡衣, 小熊印花睡衣, 开襟睡衣, 短裤睡衣套装, 可爱居家服, 夏季睡衣"
}
},
"meta_description": {
"default": "Shop this cute women's cartoon bear pajama set featuring a breathable short-sleeve cardigan and comfy shorts—perfect for sleep and relaxing at home.",
"languages": {
"it": "Acquista questo grazioso pigiama da donna con stampa di orsetti, cardigan traspirante a maniche corte e comodi pantaloncini, perfetto per dormire e rilassarsi.",
"tw": "選購這款可愛女士卡通小熊睡衣套裝,透氣短袖開襟上衣搭配舒適短褲,適合睡眠與居家放鬆。",
"de": "Entdecken Sie dieses niedliche Damen-Pyjama-Set mit atmungsaktivem Kurzarm-Cardigan und bequemen Shorts – ideal zum Schlafen und Entspannen.",
"ja": "通気性の良い半袖カーディガンと快適なショートパンツを備えた可愛いベアプリントのレディースパジャマ。就寝やリラックスタイムに最適です。",
"cn": "选购这款可爱女士卡通小熊睡衣套装,透气短袖开襟上衣搭配舒适短裤,非常适合睡眠与居家放松。"
}
},
"status": 1,
"virtual_sales_count": 0,
"meta_is_edit": 1,
"type": 2,
"vendor": "",
"variant_need_image": 1,
"inventory_police": 1,
"inventory_police_type": 1,
"handle": "cartoon-bear-printing-womens-cardigan-pajamas-short-sleeve-shorts-household-clothing-suit",
"variant_need_note": "1"
},
"images": [
{
"position": 1,
"src": "/product/15/image/2023/01/30/5b17ccf2483c46a900f569aac7924c61.jpg",
"alt": ""
},
{
"position": 2,
"src": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg",
"alt": ""
},
{
"position": 3,
"src": "/product/15/image/2023/01/30/7ffd9f95c0c286688a4227ada013ad46.jpg",
"alt": ""
},
{
"position": 4,
"src": "/product/15/image/2023/01/30/c9e676731970bce0df818ad76c8ec6ea.jpg",
"alt": ""
},
{
"position": 5,
"src": "/product/15/image/2023/01/30/480d64f2fca90319e4d899d6f63a8735.jpeg",
"alt": ""
},
{
"position": 6,
"src": "/product/15/image/2023/01/30/3f0b6db5065e0ac910940f3b0bd8e445.jpg",
"alt": ""
}
],
"collection_ids": [
44
],
"options": [
{
"name": {
"default": "Color",
"languages": {
"it": "Colore",
"tw": "顏色",
"de": "Farbe",
"cn": "颜色",
"ja": "カラー"
}
},
"position": 1,
"items": [
{
"default": "Green",
"languages": {
"it": "Verde",
"tw": "綠色",
"cn": "绿色",
"de": "Grün",
"ja": "グリーン"
}
}
]
},
{
"name": {
"default": "Size",
"languages": {
"it": "Taglia",
"tw": "尺寸",
"cn": "尺寸",
"de": "Größe",
"ja": "サイズ"
}
},
"position": 2,
"items": [
{
"default": "M",
"languages": {
"it": "M",
"tw": "M",
"de": "M",
"cn": "M",
"ja": "M"
}
},
{
"default": "L",
"languages": {
"it": "L",
"tw": "L",
"de": "L",
"cn": "L",
"ja": "L"
}
},
{
"default": "XL",
"languages": {
"it": "XL",
"tw": "XL",
"de": "XL",
"cn": "XL",
"ja": "XL"
}
},
{
"default": "2XL",
"languages": {
"it": "2XL",
"tw": "2XL",
"cn": "2XL",
"de": "2XL",
"ja": "2XL"
}
},
{
"default": "3XL",
"languages": {
"it": "3XL",
"tw": "3XL",
"cn": "3XL",
"de": "3XL",
"ja": "3XL"
}
}
]
}
],
"variants": [
{
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652L28037",
"barcode": "",
"qty": 79,
"option1": {
"default": "Green",
"languages": {
"it": "Verde",
"tw": "綠色",
"cn": "绿色",
"de": "Grün",
"ja": "グリーン"
}
},
"option2": "M",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"note": "",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
},
{
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652M28037",
"barcode": "",
"qty": 66,
"option1": {
"default": "Green",
"languages": {
"it": "Verde",
"tw": "綠色",
"cn": "绿色",
"de": "Grün",
"ja": "グリーン"
}
},
"option2": "L",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"note": "",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
},
{
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652XL28037",
"barcode": "",
"qty": 97,
"option1": {
"default": "Green",
"languages": {
"it": "Verde",
"tw": "綠色",
"cn": "绿色",
"de": "Grün",
"ja": "グリーン"
}
},
"option2": "XL",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"note": "",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
},
{
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652XXL28037",
"barcode": "",
"qty": 123,
"option1": {
"default": "Green",
"languages": {
"it": "Verde",
"tw": "綠色",
"cn": "绿色",
"de": "Grün",
"ja": "グリーン"
}
},
"option2": "2XL",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"note": "",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
},
{
"price": "13.28",
"compare_at_price": "0.00",
"cost_price": "0.00",
"sku": "697712001652XXXL28037",
"barcode": "",
"qty": 70,
"option1": {
"default": "Green",
"languages": {
"it": "Verde",
"tw": "綠色",
"cn": "绿色",
"de": "Grün",
"ja": "グリーン"
}
},
"option2": "3XL",
"option3": "",
"weight": "0.00",
"weight_unit": "kg",
"note": "",
"image": "/product/15/image/2023/01/30/b169d0172b6e8f474aa47190160434f0.jpg"
}
],
"tags": [
"red",
"spring",
"sea"
]
}
数据返回部分
1.Response JSON Data(Body):
格式:json
| 参数名称 | 是否必须 | 类型 | 描述 |
|---|---|---|---|
| code | 必须 | Number | 200 代表成功 |
| message | 必须 | String | 执行结果的文字描述信息 |
| data | 必须 | Array | api获取的数据保存到data中 |
| data > product_id | 必须 | int | 产品id |
Response JSON Data(示例数据):
{
"code": 200,
"data": {
"product_id": 4613
},
"message": "success"
}