Skip to navigation

查詢單一組合品

View as Markdown

依組合 SKU 序號查詢單一組合品,含所在商品頁(productId)與完整配方;組合品自身的庫存請查 GET /v1/bundles/{id}/stock。若該 id 不存在、屬於其他租戶,或指向的是一般規格,一律回傳 404 not_found,這幾種情況無法從回應內容區分。

Authentication

X-Signaturestring

每個 /v1 請求都必須帶 X-Client-Id、X-Timestamp、X-Nonce 與 X-Signature 四個標頭。X-Signature 是以 client secret 對 canonical string 做 HMAC-SHA256 後的 Base64。

canonical string 的組成、可複製的簽章範例與 401 排查步驟,請參閱「驗證與簽章」。

Path parameters

idlongRequired

要查詢的組合 SKU 序號(GET /v1/bundles 回傳的 id)。不存在、屬於其他租戶,或指向一般規格時,一律回傳 404 not_found。

Response

OK
idlongOptional

組合 SKU 序號。組合品的寫入與組合品價格端點用的都是這個序號。

productIdlongOptional

組合 SKU 所在的商品頁序號;沒有放在任何商品頁時為 0。

outerSysCodestring or nullOptional

ERP 端的組合品料號。

namestring or nullOptional

組合品名稱。

statusstring or nullOptional

組合品狀態,與規格相同共三種:Active(上架)、Inactive(下架)、GiftOnly(僅供贈品)。可以透過建立或更新組合品寫入;建立時省略為 Active。

unitstring or nullOptional

商品單位。

specstring or nullOptional

規格內容。

barcodestring or nullOptional

條碼。

warehousestring or nullOptional

倉別。

pricedoubleOptional

牌價,與組合品價格家族讀寫的是同一個欄位,也可以用 GET /v1/bundles/{id}/price 單獨查詢。⚠️ 規格價格家族(PUT /v1/prices/batch)對組合 SKU 一律回傳 not_found,不要對組合品打那支端點。

sellPricedoubleOptional

對外售價,與 price 同樣可由 GET /v1/bundles/{id}/price 單獨查詢。

quantityPrecisionintegerOptional

數量精度(0 為整數,1 至 4 為小數位數)。

isNegativeStockAllowedbooleanOptional

組合品自身是否允許負庫存:true 時自身不限量、只看組成規格;false 時組合品自身的可售數用完就不能再下單。

componentslist of objects or nullOptional

配方,每一筆為一個元件列;一個組合品至少有 1 個元件。

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error