HomeGuidesAPI ReferenceChangelogDiscussions
HomeLog In
Guides

Add Live Products

Function

Support batch adding products, allowing maximum 100 items to be added in an API call.
支持批量添加商品到直播,單次最多允許添加 100 件商品。

Please refer to https://open-api.docs.shoplineapp.com/reference/post_sales-saleid-products for more details.

📘

Notice

  • This API supports batch adding of products, allowing a maximum of 100 items to be added in a single operation.
  • For LINE channel, a single variation (or products without variations) is only allowed to have one keyword or product number.
  • The products[].custom_keys field is only effective for products without variations, while the products[].variations[].custom_keys field is only effective for products with single or multiple variations.
  • custom_keys and custom_number fields are mutually exclusive. If custom_number is filled, custom_keys should be left empty. If custom_keys are filled, it must ensure that all custom_keys fields are filled and meet the rules, while custom_number should be left empty.

URL

POST <<api_domain>>/v1/sales/:sale_id/products

Request Parameters

ParameterTypeDescriptionExample
sale_id
*Required
StringSale Event ID
直播間 ID
61a77ab95972890008b40106
products
*Required
List<Object>Product Lists
商品列表
(Please refer to request example)
products[].product_id
*Required
StringProduct ID
商品 ID
products[].custom_numbersList<String>Product Custom Numbers
商品編號
products[].custom_keysList<String>Product Custom Keys
商品關鍵字(無規格商品),最多支援 3 個
Product keywords (effective when there are no variations), supports maximum 3 keywords.
products[].variationsList<Object>Variations
規格品
products[].variations[].variation_id
*Required
StringVariation ID
規格品 ID
products[].variations[].custom_keys
*Required
List<String>Variation Custom Keys
規格品關鍵字,最多支援 3 個
Variation keywords, supports maximum 3 keywords.

Response Parameters

ParameterTypeDescriptionExample
itemsList<Object>Sale Event Product Lists
直播間商品列表
items[].product_idStringProduct ID
商品 ID
items[].custom_numbersList<String>Product Custom Numbers
商品編號
items[].custom_keysList<String>Product Custom Keys
商品關鍵字
items[].effective_keyBooleanKeyword Effectiveness
關鍵字是否生效
Whether the keywords are effective
items[].create_timeDateTimeCreate Time
創建時間
items[].update_timeDateTimeUpdate Time
更新時間
items[].variationsList<Object>Variations
規格品
items[].variations[].variation_idStringVariation ID
規格品 ID
items[].variations[].custom_keysList<String>Variation Keyword Lists
規格品關鍵字列表

Error Code

CodeDescription
SC_POST_0102The quantity of products added in a single operation exceeds the limit.
單次添加商品的數量超過限制
SC_POST_0103The keywords of products or variations are duplicated.
商品或規格品關鍵字重複
SC_POST_0104The keyword is invalid.
關鍵字不合法
SC_POST_0105The product or variation has already been added.
商品或規格品已經被加入直播間
SC_POST_0106SKU missing, or data in variations and product_detail does not match.
SKU 缺失,或是 variations 和 product_detail 中的資訊不相符
SC_POST_0107There is a task in progress. Please try again later.
任務進行中,請稍後再試