本文檔說明臺灣淘寶商品管理的第三方開發者或者自研發商家如何透過開放平台進行商品發布管理。
ISV可根據此教程使用相關API製作發布商品的工具
在調用CreateProduct前,需要先調用GetCategoryTree取得所有類目的清單、GetCategoryAttributes取得產品類目的產品内容清單、GetBrands取得產品的品牌名稱、UploadImage從本地上傳圖片至服務器
詳情請參考接口文檔:https://open.taobao.tw/doc/doc.htm#?nodeId=27984&docId=118967
調用GetCategoryTree接口,得到category_id;
請求參數說明:無
響應參數說明:所有可用的類目
請求參數示例
除公共請求參數外,沒有其他請求參數
溫馨提示:本示例中,“leaf=true”表示類目是一個葉子類目,可用於新建商品,相反的若leaf=false,則表示您的商品不能建立在此類目下。
{
"result": {
"data": [
{
"children": [
{
"children": [
{
"var": false,
"name": "擴大機 (新)",
"leaf": true,
"category_id": 40100875
},
{
"var": false,
"name": "更換用耳塞 (新)",
"leaf": true,
"category_id": 40100874
},
{
"var": false,
"name": "其他耳罩式耳機配件",
"leaf": true,
"category_id": 41000190
}
],
"var": false,
"name": "耳罩式耳機配件",
"leaf": false,
"category_id": 40100388
},
{
"children": [
{
"var": false,
"name": "纜線 (新)",
"leaf": true,
"category_id": 40100395
},
{
"var": false,
"name": "支座 (新)",
"leaf": true,
"category_id": 40100396
}
],
"var": false,
"name": "專業音訊配件",
"leaf": false,
"category_id": 40100394
},
],
},
] ,
"success": true,
"class": "com.alibaba.normandie.gateway.client.domain.lazop.APIResult"
},
"code": "0",
"request_id": "0b1196a615933101217536048"
}
調用 GetCategoryAttributes 接口,通過得到的 category_id,得到該類目的產品屬性列表
產品屬性分為共通屬性與類目獨有屬性, 因類目屬性族繁不及備載,請確實查詢該類目下的獨有屬性做為創建商品的傳入參數 。共通屬性的參數說明請查閱本文件的最後一節:共通參數說明
請求參數說明:categoryId
響應參數說明:所有的類目屬性項和屬性值
請求參數示例
“categoryId”:“40100388”
響應參數示例
{
"data": [
{
"is_sale_prop": 0,
"options": [],
"name": "name",
"inputType": "text",
"is_mandatory": 1,
"property_id": 100043175
},
{
"is_sale_prop": 0,
"options": [],
"name": "package_length",
"inputType": "numeric",
"is_mandatory": 1,
"property_id": 224404846
},
{
"is_sale_prop": 0,
"options": [],
"name": "package_width",
"inputType": "numeric",
"is_mandatory": 1,
"property_id": 224404847
},
{
"is_sale_prop": 0,
"options": [
{
"name": "10 年",
"id": 50070493
},
{
"name": "1 年",
"id": 54411378
},
{
"name": "8 歲",
"id": 130075703
},
{
"name": "2 個月",
"id": 1878244503
},
{
"name": "30 年",
"id": 1878517492
},
{
"name": "終身保修",
"id": 4890912112
}
],
"name": "warranty",
"inputType": "singleSelect",
"is_mandatory": 0,
"property_id": 100008167
},
{
"is_sale_prop": 0,
"options": [],
"name": "package_height",
"inputType": "numeric",
"is_mandatory": 1,
"property_id": 224495602
},
{
"is_sale_prop": 0,
"options": [],
"name": "brand",
"inputType": "singleSelect",
"is_mandatory": 1,
"property_id": 20000
},
{
"is_sale_prop": 0,
"options": [],
"name": "taobao seller name",
"inputType": "text",
"is_mandatory": 0,
"property_id": 226649315
},
{
"is_sale_prop": 0,
"options": [
{
"name": "None",
"id": 3270618
},
{
"name": "液體",
"id": 6223181
},
{
"name": "帶電池",
"id": 9390368
},
{
"name": "易燃",
"id": 790268265
}
],
"name": "Hazmat",
"inputType": "multiSelect",
"is_mandatory": 0,
"property_id": 226649313
},
{
"is_sale_prop": 0,
"options": [],
"name": "price",
"inputType": "numeric",
"is_mandatory": 1,
"property_id": 100151378
},
{
"is_sale_prop": 0,
"options": [],
"name": "package_content",
"inputType": "text",
"is_mandatory": 1,
"property_id": 226649321
},
{
"is_sale_prop": 0,
"options": [
{
"name": "無保修",
"id": 1879916309
},
{
"name": "國際製造商保修",
"id": 4890910859
},
{
"name": "當地製造商保修",
"id": 4890912100
}
],
"name": "warranty type",
"inputType": "singleSelect",
"is_mandatory": 1,
"property_id": 226643310
},
{
"is_sale_prop": 0,
"options": [],
"name": "images",
"inputType": "img",
"is_mandatory": 0,
"property_id": 226643313
},
{
"is_sale_prop": 0,
"options": [],
"name": "quantity",
"inputType": "numeric",
"is_mandatory": 0,
"property_id": 101257008
}
],
"success": true,
"code": "0",
"request_id": "0b1196a615933121356098098"
}
調用GetBrands接口,得到品牌名稱(name)
請求參數說明:
響應參數說明:所有產品的品牌名稱和屬性
請求參數示例
“offset”:“50”,
“limit”:“3”
響應參數示例
{
"data": [
{
"name": "LG",
"id": 4890912139,
"name_en": "LG"
},
{
"name": "M900",
"id": 4890912140,
"name_en": "M900"
},
{
"name": "三星",
"id": 4890912141,
"name_en": "三星"
}
],
"success": true,
"code": "0",
"request_id": "0b1196a615946209600915100"
}
調用UploadImage接口,得到已上傳圖片的訪問地址(url)
請求參數說明:圖片名稱和內容
響應參數說明:已上傳圖片的地址和哈希值
請求參數示例
“fileName”:“我的商品圖片.jpg”,
“image”:“[0,1,1]”
響應參數示例
{
"code": "0",
"data": {
"hash_code": "61bdf049525b7d4c2cf79257ec7c2c56",
"url": "https://img-ovs.alicdn.com/p/myproduct.jpg"
},
"request_id": "0ba2887315178178017221014"
}
調用CreateProduct接口,創建商品。建立商品的時候,傳入的參數會因為第二步的產品類目不同,需要傳入不同的產品屬性欄位,必須注意這些欄位有些可能為必填(is_mandatory=1),當該屬性欄位為必填時,需要全部填入後才能成功呼叫。
請求參數示例
{ "attributes":
{
"brand": "順其自然",//通过GetBrands接口得到的name
"name": "測試產品",
"short description": "品牌 : 10COM/十厘米 面料 : 棉 貨號 : 234 成分含量 : 96%及以上",
"description": "這是商品詳細描述",
"warranty type": 2000004004,
"warranty": 50070493,
"product warranty": "這是商品保固政策",
"Hazmat": "6223181,9390368,790268265",
"deliveryPeriod": 2,
"pickupPoint": [
{
"value": "FAMILY_MART" },
{
"value": "SEVEN_11" },
{
"value": "HI_LIFE" }
]
},
"catId": 30004375,//通过GetCategoryTree接口得到的category_id
"skuList": [
{ "SellerSku": "600024363964776987-123",
"package_weight": 0.05,
"package_length": 10,
"package_width": 10,
"package_height": 10,
"color family": "黑色",
"size": "50",
"quantity": 100,
"package_content": "default",
"images": [ //通过UploadImage接口得到的已上传图片的访问地址(url)
"https://img-ovs.alicdn.com/other/gsp/e4b96b68d61f18a93aaab544d278b8ef.jpeg",
"https://img-ovs.alicdn.com/other/gsp/457b5f1fc50604e317f1e605c5b53aa7.jpeg",
"https://img-ovs.alicdn.com/other/gsp/2e28843f17dba8148224650ec212a859.jpeg"
],
"price": 68,
"lossThresholdPrice": 55,
"Status": "active"
}
]
}
響應參數示例
{
"code": "0",
"data": {},
"request_id": "0ba2887315178178017221014"
}
| 參數名稱 | 參數類型 | 是否必填 | 說明 |
|---|---|---|---|
| brand | String | 是 | 填入 3、取得產品品牌名稱 中取得的品牌名稱,如果沒有品牌,可以填入 NO BRAND |
| name | String | 是 | 商品名稱 |
| short description | String | 是 | 商品短描述 |
| description | String | 否 | 商品詳細描述 |
| warranty type | String | 否 | 保固類型,請依照以下選單填寫保固類型ID,只能傳回一個值 1879916309:無保修 2000004004:當地供應商保修 4890910859:國際製造商保修 4890912097:國際賣家保修 4890912100:當地製造商保修 |
| warranty | String | 否 | 保固期,請依照以下選單填寫保固期ID,只能傳回一個值 61356472 : 1 Month 1878244503: 2 Months 66256336: 3 Months 84080222: 4 Months 88687276: 5 Months 87865024: 6 Months 1520237840: 7 Months 717374871: 8 Months 155652810: 9 Months 1878243078: 10 Months 842392822: 11 Months 4890912112: Life Time Warranty 54411378: 1 Year 74317991: 2 Years 62405572: 3 Years 153291299: 4 Years 149360996: 5 Years 137903252: 6 Years 111062392: 7 Years 130075703: 8 Years 792262005: 9 Years 50070493: 10 Years 84151124: 18 Months 150823067: 15 Years 141662757: 20 Years |
| product warranty | String | 否 | 請詳述您的保固政策 |
| Hazmat | String | 否 | 危險物品,請依照以下項目填入危險類型ID,多個值請以逗號分隔。 6223181: 液體 9390368: 帶電池 790268265:易燃 |
| deliveryPeriod | String | 否 | 備貨期,單位為日。請填入1-30之間的整數 |
| pickupPoint | JSON | 否 | 若使用官方超商取貨/超取付款,請參考下方 pickupPoint 說明 |
| sellerSelfDelivery | JSON | 否 | 若使用賣家宅配,請參考下方 sellerSelfDelivery 說明 |
| localLogisticDelivery | JSON | 否 | 若使用官方宅配,請參考下方 localLogisticDelivery 說明 |
| skuList | JSON | 是 | 請依照下方 skuList 說明填入商品的SKU詳細資訊 |
| 參數名稱 | 參數類型 | 是否必填 | 說明 |
|---|---|---|---|
| supportCod | boolean | 是 | 是否使用貨到付款 |
| value | String | 是 | FAMILY_MART:全家 SEVEN_11:711便利店 HI_LIFE:萊爾富 |
| 參數名稱 | 參數類型 | 是否必填 | 說明 |
|---|---|---|---|
| value | String | 是 | 目前只支援賣家自行宅配,請傳入seller |
| input | Long | 是 | 運費 |
| 參數名稱 | 參數類型 | 是否必填 | 說明 |
|---|---|---|---|
| value | String | 是 | 目前只支援宅配,請傳入home |
| 參數名稱 | 參數類型 | 是否必填 | 說明 |
|---|---|---|---|
| SellerSku | String | 是 | 請填入在您自己系統使用的SKU ID |
| package_weight | Double | 是 | 包裝重(公斤),用以計算邏輯包裹使用,建議確實填寫 |
| package_length | Double | 是 | 包裝長(公分),用以計算邏輯包裹使用,建議確實填寫 |
| package_width | Double | 是 | 包裝寬(公分),用以計算邏輯包裹使用,建議確實填寫 |
| package_height | Double | 是 | 包裝高(公分),用以計算邏輯包裹使用,建議確實填寫 |
| quantity | Long | 否 | 商品數量 |
| package_content | String | 否 | 包裝內容簡述 |
| images | Array | 否 | 商品圖URL,請先使用 4、從本地上傳圖片至服務器 ,取得回傳的商品圖URL後將URL傳入此處。 |
| price | Double | 是 | 商品售價 |
| special price | Double | 否 | 商品促銷價 |
| special from date | Date | 否 | 促銷價開始日期 YYYY-MM-DD HH:mm:ss |
| special to date | Date | 否 | 促銷價結束日期 YYYY-MM-DD HH:mm:ss |
| lossThresholdPrice | Double | 否 | 商品底價 |
| Status | String | 否 | 商品狀態: 請指定商品初始化狀態,在商品新增時,可以使用的為: 上架及下架 acitve: 上架 live: 在線 inactive:下架 deleted: 已刪除 image-missing: 圖片缺失 pending: 審核中 rejected: 審核拒絕 sold-out: 已賣空 |