查詢單一商品

View as Markdown

依 id 查詢單一商品。若該 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

要查詢的商品序號。不存在或屬於其他租戶時,一律回傳 404 not_found。

Response

OK
idlongOptional

商品序號。

outerSysCodestring or nullOptional

ERP 端的商品代碼。

namestring or nullOptional

商品名稱。

statusstring or nullOptional

商品狀態,共三種:Active(上架)、Inactive(下架,前台完全不會陳列)、InactiveVisible(下架-顯示,前台仍會陳列,但標示為不可購買)。狀態值只能在後台維護,本 API 目前不提供寫入;透過本 API 建立的商品一律為 Active。

productCategoryIdlongOptional

商品目前所屬的分類 id,方便 ERP 核對自己設定的值是否生效。

Errors

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