HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Add or Remove Product tag

PATCH https://open.shopline.io/v1/products/{productId}/tags

Add or Remove current product tags with input tags array.
Each tag mush have at least 3 characters and at most 40 characters.
When update with invalid length of tags, the update will fail and the respond will be 422.
Must pass at least one tag, otherwise the update will fail and the respond will be 422.
在現有的商品標簽新增/移除標簽。
每一個商品標籤必須有最少3個字完及最多40個字完。
若需更新的商品標籤其中之一不符字完長度規範,更新不會成功及將回傳狀態碼422。
必須最少新增/移除一個標籤,否則更新不會成功及將回傳狀態碼422。

Request Sample

curl --request PATCH \
     --url https://open.shoplineapp.com/v1/products/productId/tags \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --data '
{
     "update_mode": "add",
     "tags": [
          "tag1",
          "tag2"
     ]
}
'

Path Param

id Required string Product's ID
商品ID

Body Param

tags Required Array of string array of tags to add / remove
update_mode Required string enum add / remove tags

Request Response

{
  "tags": [
    "original tag",
    "tag1",
    "tag2"
  ]
}

Response Param

tags Array of string Updated product tags array
更新後的商品標簽array