賣場屬性調整提案 #
驗證欲加入的賣場屬性商品 #
DryRun 賣場屬性調整提案單
。
Endpoint URL: https://tw.supplier.yahoo.com/api/spa/v1/proposal/updateListingModels
HTTP Method: POST
Request Parameters #
dryrun #
驗證屬性商品是否可加入賣場屬性商品。
資料型態: Boolean
必填: 是
有效值: 設定為 true
時,可將欲驗證的商品 SKU 放進 skuCandidates 進行驗證,確認是否能加入該賣場做為屬性商品
isGift #
驗證商品是否可加入賣場贈品,只有在 dryrun 設定為 true
時有效。
資料型態: Boolean
必填: 否
有效值: 設定為 true
時,可將欲驗證的商品 SKU 放進 skuCandidates 進行驗證,確認是否能加入該賣場做為贈品
預設值: false
isAdditionalPurchases #
驗證商品是否可加入賣場加價購,只有在 dryrun 設定為 true
時有效。
資料型態: Boolean
必填: 否
有效值: 設定為 true
時,可將欲驗證的商品 SKU 放進 skuCandidates 進行驗證,確認是否能加入該賣場做為加價購商品
預設值: false
Request Body #
listing #
賣場資訊。
資料型態: ProposalListing
必填: 是
欄位說明: 賣場 ID 為必填
skuCandidates #
DryRun 模式下輸入欲驗證的屬性商品,可填寫多筆 sku
做驗證。
資料型態: Integer[]
必填: 是
applicant #
提案人。
資料型態: String
必填: 是
長度限制: 最長 10 個字
格式: 繁/簡體中文
Request/Response Syntax #
- 驗證屬性商品: POST /api/spa/v1/proposal/updateListingModels?dryrun=true
- 驗證贈品商品: POST /api/spa/v1/proposal/updateListingModels?dryrun=true&isGift=true
- 驗證加價購商品: POST /api/spa/v1/proposal/updateListingModels?dryrun=true&isAdditionalPurchases=true
{
"applicant": string,
"listing": {
"id": number
},
"skuCandidates": [
number,
number
]
}
{
"supplierId": string,
"subStationId": string,
"subStationName": string,
"applicant": string,
"expiredTs": string,
"contactWindow": string,
"createdTs": string,
"creator": string,
"modifiedTs": string,
"modifier": string,
"reviewStatus": string,
"note": string,
"listing": {
"id": number,
"origLayer": number
},
"allowedSkuList": [
number
],
"products": [
{
"id": number,
"sku": number,
"supplierId": number,
"name": string,
"cost": string,
"partNo": string,
"stock": number,
"availableCount": number,
"images": [
{
"url": string,
"width": number,
"height": number,
"order": number
}
],
"parentSpec": {
"name": string,
"selectedValue": string
},
"spec": {
"name": string,
"selectedValue": string
},
"structuredData": {
"attributes": [
{
"name": string,
"values": [
string
]
}
],
"struDataAttrClusterId": string
},
"isExpiringItem": boolean,
"isInstallRequired": boolean,
"isNeedRecycle": boolean,
"minPackingCount": number,
"taxable": boolean,
"msrp": string,
"brand": string,
"length": number,
"width": number,
"height": number,
"weight": number,
"preserveDays": number,
"catId": string,
"catItemId": string,
"isSoftGame": boolean,
"gameContents": [
string
],
"shipType": {
"id": number,
"type": string
}
}
],
"errors": [
{
"code": number,
"invalidValue": string,
"message": string
}
]
}
Response Elements #
若操作成功,API 會回傳 HTTP 200 response,並以 JSON 格式完整回傳 UpdateListingModelProposal 物件。
supplierId #
供應商編號。
資料型態: Integer
listing #
賣場資訊。
資料型態: ProposalListing
subStationId #
提案當下的提案子站編號,e.g. sub1
。
資料型態: String
subStationName #
提案當下的提案子站名稱。
資料型態: String
applicant #
提案人。
資料型態: String
creator #
建檔者。
資料型態: String
allowedSkuList #
驗證成功被允許加入賣場的屬性商品。
資料型態: Integer[]
products #
允許加入賣場的屬性商品詳細資訊。
資料型態: Product[]
欄位說明
欄位名稱
資料型態
欄位說明
id
Integer
Product ID (SKU)
name
String
商品名稱
partNo
String
商品貨號
sku
Integer
商品 ID
stock
Integer
商品庫存
cost
String
商品成本
images
ProductImage[]
商品圖片
structuredData
StructuredData
商品規格表
spec
Attribute
單層屬性商品的屬性名稱與項目 / 雙層屬性商品的第 2 層屬性名稱與項目
parentSpec
Attribute
雙層屬性商品的第 1 層屬性名稱與項目,單層及無屬性商品無此欄位。
isExpiringItem
Boolean
是否為即期品
isInstallRequired
Boolean
是否需要安裝
isNeedRecycle
Boolean
是否屬於廢四機
minPackingCount
Int32
最小包裝數
taxable
Boolean
商品是否應稅
msrp
String
廠商建議價
brand
String
品牌
length
Int32
包裝完成後的商品長度
width
Int32
包裝完成後的商品寬度
height
Int32
包裝完成後的商品高度
weight
Int32
包裝完成後的商品重量
preserveDays
Int32
商品保存期限
catId
String
商品目前的分類父類 ID, e.g. cat1610
catItemId
String
商品目前的分類子類 ID, e.g. catItem21704
isSoftGame
Boolean
是否為遊戲軟體
gameContents
String[]
遊戲情節內容,若
isSoftGame = false
則此欄位為空
shipType
ShipType
配送方式
availableCount
Int32
商品可售數量
errors #
欲驗證的屬性商品不允許加入賣場的錯誤訊息。
資料型態: ErrorDetail[]
Errors #
Bad Request #
輸入的參數不符合 API 定義的 Pattern。
HTTP Status Code: 400
Error Code | Description |
---|---|
0 | Invalid input |
40000011 | Invalid ISO-8601 format |
40000010 | Multiple bad parameters |
40000013 | The field is unchangeable |
40000023 | Constraint violation validate error |
40009104 | Cannot PUT the proposal which review status isn’t composing and draft |
40009127 | Invalid listing ID |
40009147 | Invalid listing type |
40009148 | The listing does not allow to adjust the model |
40009149 | The product ID is invalid |
40009150 | The sku’s supplier ID is different from the listing’s |
40009151 | The sku’s cost is different from the listing’s |
40009152 | The sku’s ship type is different from the listing’s |
40009153 | The sku’s outright purchase status is different from the listing’s |
40009154 | The sku’s attribute spec name is different from the listing’s |
40009155 | The sku’s attribute item spec name is different from the listing’s |
40009156 | The sku’s sub station ID is different from the listing’s |
40009157 | The sku’s structure attribute cluster ID is different from the listing’s |
40009158 | The gift sku does not allow to be added to the listing model |
40009159 | Invalid product conditions |
40009160 | The sku hasn’t entered the warehouse |
40009161 | Invalid product conditions |
40009162 | Invalid sku abstract status |
40009163 | The listing with delivery type preOrder and customized could not be adjusted the model |
40009164 | The sku does not allow added in the normal delivery listing |
40009165 | The sku does not allow added in the appointment delivery listing |
40009166 | The sku does not allow added in the express delivery listing |
40009167 | Duplicate sku ID in listing |
40009168 | Mismatch product and listing attribute layer |
40009169 | The sku ID not in listing models |
40009170 | Duplicate spec value in listing models |
40009171 | Duplicate item spec value in listing models |
40009172 | Least contain one spec in listing models |
40009173 | Least contain one item spec in listing models |
40009174 | Mismatch proposal and listing attribute layer |
40009175 | Invalid model quantity |
40009176 | Invalid model’s item quantity |
40009177 | Duplicate sku ID in proposal |
40009178 | Invalid product conditions |
40009179 | Invalid product conditions |
40009180 | The model’s attribute spec name is different from the listing’s |
40009181 | The model’s attribute item spec name is different from the listing’s |
40009182 | The structure data attribute cluster ID inconsistent in listing |
40009183 | The structure data attribute cluster ID inconsistent in proposal |
40009185 | Must retain one visible model in a listing or item in a model |
40009201 | There are inconsistent spec name in the proposal |
40009202 | Duplicate SKU with the main product of the listing |
40009203 | The SKU not in listing complimentaries |
40009204 | Invalid gift cost |
40009205 | Invalid gift category |
40009206 | Cannot validate gift and additional purchase simultaneously |
40009207 | Invalid gift select minimum quantity |
40009208 | Invalid gift specification selected value length |
40009209 | Invalid listing attribute count |
40009210 | Invalid additional purchase cost |
40009211 | Invalid additional purchase price |
40009230 | The sku’s tax type is different from the listing’s |
Unauthorized #
身分認證不通過,請檢查您的 Cookie
或 wssid
。
HTTP Status Code: 401
Error Code | Description |
---|---|
40100001 | Missing or bad authentication |
40100002 | Invalid cookie |
40100003 | Missing or bad authentication |
40100004 | Check wssid failed |
40100006 | Cookie has expired |
Forbidden #
權限驗證不通過,請確認您有權操作更新賣場屬性調整提案,且為您所提案的賣場的擁有者。
HTTP Status Code: 403
Error Code | Description |
---|---|
40304001 | No permission |
Unprocessable Entity #
提案單狀態驗證不通過,請確認提案單狀態。
HTTP Status Code: 422
Error Code | Description |
---|---|
42209002 | Invalid state flow of proposal review status |
Internal Server Error #
API 端發生錯誤,若持續發生請洽您的業務窗口。
HTTP Status Code: 500
Examples #
驗證商品 6677907 與 6677110 是否可加入賣場 3408438
POST /api/spa/v1/proposal/updateListingModels?dryrun=true HTTP/1.1
HOST: tw.supplier.yahoo.com
Content-Type: application/json; charset=UTF-8
{
"applicant": "applicant-name",
"listing": {
"id": 3408438
},
"skuCandidates": [
6677907,
6677110
]
}
- 商品
6677907
為驗證成功並可以加入賣場的屬性商品,並且從products
陣列可以查詢
到此商品的詳細資訊。 - 商品
6677110
為驗證失敗的屬性商品,從errors
陣列可以查詢到驗證失敗的原因。
{
"allowedSkuList": [
6677907
],
"applicant": "applicant-name",
"contactWindow": "contactWindow-name",
"creator": "creator-id",
"errors": [
{
"code": 40009150,
"invalidValue": "skuCandidates[1]: 6677110",
"message": "[40009150] The sku's supplier ID is different from the listing's"
},
{
"code": 40009151,
"invalidValue": "skuCandidates[1]: 6677110",
"message": "[40009151] The sku's cost is different from the listing's"
},
{
"code": 40009152,
"invalidValue": "skuCandidates[1]: 6677110",
"message": "[40009152] The sku's ship type is different from the listing's"
}
],
"expiredTs": "2022-01-18T16:00:00Z",
"listing": {
"applyLowGpm": false,
"id": 3408438,
"isThresholdFreebie": false,
"shareMediaBetweenModels": false,
"syncProductImages": true,
"origLayer": 2
},
"modifiedTs": "2022-01-04T06:39:17Z",
"modifier": "modifier-id",
"products": [
{
"cost": "80.00",
"id": 6677907,
"images": [
{
"height": 1000,
"order": 1,
"url": "https://img.yec.tw/zo/MerchandiseImages/ECC24EC118-SP-484183.jpg",
"width": 1000
},
{
"height": 400,
"order": 1,
"url": "https://img.yec.tw/zo/MerchandiseImages/3E57694544-SP-484183.jpg",
"width": 400
},
{
"height": 250,
"order": 1,
"url": "https://img.yec.tw/zo/MerchandiseImages/F4F663B8A8-SP-484183.jpg",
"width": 250
},
{
"height": 135,
"order": 1,
"url": "https://img.yec.tw/zo/MerchandiseImages/AB651ADB0A-SP-484183.jpg",
"width": 135
},
{
"height": 80,
"order": 1,
"url": "https://img.yec.tw/zo/MerchandiseImages/7B397A0C6C-SP-484183.jpg",
"width": 80
},
{
"height": 1000,
"order": 2,
"url": "https://img.yec.tw/zo/MerchandiseImages/3AE2CF332F-SP-484183.jpg",
"width": 1000
},
{
"height": 400,
"order": 2,
"url": "https://img.yec.tw/zo/MerchandiseImages/9645CDE9D5-SP-484183.jpg",
"width": 400
}
],
"name": "雙層宅配賣場-米色系-693",
"parentSpec": {
"name": "顏色",
"selectedValue": "米色系"
},
"sku": 6677907,
"spec": {
"name": "商品尺寸",
"selectedValue": "693"
},
"stock": 10,
"availableCount": 10,
"structuredData": {
"attributes": [
{
"name": "商品品牌",
"values": [
"5th STREET"
]
},
{
"name": "顏色",
"values": [
"米色系"
]
},
{
"name": "商品尺寸",
"values": [
"693"
]
}
],
"struDataAttrClusterId": "000003414671"
},
"isExpiringItem": false,
"isInstallRequired": true,
"isNeedRecycle": true,
"minPackingCount": 1,
"taxable": true,
"msrp": "100.00",
"brand": "品牌",
"length": 55,
"width": 66,
"height": 77,
"weight": 88,
"preserveDays": 56,
"catId": "cat430",
"catItemId": "catItem10070",
"isSoftGame": false,
"shipType": {
"id": 61,
"type": "Express24HR"
}
}
],
"reviewStatus": "draft",
"skuCandidates": [
6677907,
6677110
],
"subStationId": "sub10",
"subStationName": "sub-station-name",
"supplierId": 99999
}