事件分组事件标识
product_listingsproduct_listings/add
当商品被添加到销售渠道时触发。
请求头
  • Content-Type string required
    字段值固定为 application/json; charset=utf-8。
  • X-Shopline-Topic string required
    事件的唯一标识。
    例子: orders/edited
  • X-Shopline-Hmac-Sha256 string required
    该请求的签名。收到请求后,你需要对该签名进行 验签 以验证数据的真实性和完整性。
    例子: XWmrwMey6OsLMeiZKwP4FppHH3cmAiiJJAweH5Jo4bM=
  • X-Shopline-Shop-Domain string required
    店铺的域名。
    例子: example.myshopline.com
  • X-Shopline-Shop-Id string required
    店铺 ID。
    例子: 1610418123456
  • X-Shopline-Merchant-Id string required
    商家 ID。
    例子: 2000001234
  • X-Shopline-API-Version string required
    API 版本号。
    例子: v20250601
  • X-Shopline-Webhook-Id string required
    该 Webhook 事件的 ID。
    例子: b54557e48a5fbf7d70bcd043
请求体
  • product_listingobject
    商品信息。
  • body_html string
    商品的描述。
  • combined_listingobject
    组合商品关联信息对象,存放组合商品的父商品与子商品关联标识信息。
  • combined_listing_children_ids array
    组合商品下的子商品 ID 列表。
    例子: ["16057850264845250791280282","16057850264845250333280282"]
  • parent_product_id string
    组合商品的父商品 ID。
    例子: 16050375155238626683133099
  • combined_listing_role string
    商品在组合商品中的角色。有效枚举值包含:
    • parent:表示组合商品的父商品。
    • child:表示组合商品的子商品。
    • no_role:表示非组合的独立售卖商品。
  • created_at string
    商品的创建日期和时间。格式:ISO 8601。
    例子: 2025-03-06T02:20:26+08:00
  • handle string
    商品的语义化的唯一标识,默认基于 title 生成。
    例子: product
  • id string
    商品的唯一标识 ID。
    例子: 16057850264845250791280282
  • imagesobject[]
    商品图片列表。
    废弃:该字段自 API 版本 v20260301 起已废弃。
  • alt string
    商品图的替代文本描述,通常是具有图片特征或内容的单词或短语。
    例子: This is an image alt.
  • src string
    商品图的链接。
    例子: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • optionsobject[]
    商品规格列表。
  • id string
    规格的唯一标识 ID。
    例子: 16158068291703878544960282
  • name string
    规格的名称。
    例子: Color
  • option_valuesobject[]
    商品规格值列表。
  • id string
    规格值的唯一标识 ID。
    例子: 16050375155238626683133099
  • value string
    规格值。
    例子: red
  • product_id string
    规格对应商品的唯一标识 ID。
    例子: 16057850264845250791280282
  • values array
    规格值列表。
    例子: ["red","green","white"]
  • values_images map
    规格值与对应图片 URL 的映射关系。
  • product_behavior string
    用于标识商品的特殊行为,只在特定情况下有值返回。例如,当商品有潜在风险时,返回一个值。
    例子: RISK, HIDDEN
  • product_category string
    商家自定义的商品类型。
    例子: Electronics
  • product_type string
    商品的来源。有效枚举值包含:
    • NORMAL:SHOPLINE 商家后台维护的商品
    • POD_TEMPORARY:POD 应用的临时商品
    • TEMPORARY:其他临时商品
  • published_at string
    商品发布到在线商店的日期和时间。格式:ISO 8601。
    例子: 2025-03-06T02:20:26+08:00
  • published_scope string
    商品的销售渠道发布范围。有效值固定为web,代表在线商城。
  • spu string
    商家为商品自定义的标识,区别于 SHOPLINE 生成的 product.id。
    例子: S00000001
  • standard_category_id string
    标准商品类型 ID。
    例子: 3237
  • status string
    商品的状态。有效枚举值包含:
    • active: 上架
    • draft: 下架
    • archived: 归档
  • subtitle string
    商品的摘要。
    例子: This is a subtitle
  • tags string
    商品的标签。
    例子: tag1, tag2
  • template_path string
    商品的主题模板。
    例子: templates/product.product_template_name.json
  • title string
    商品的名称。
    例子: This is a Product title
  • updated_at string
    商品最近一次更新的日期和时间。格式:ISO 8601。
    例子: 2025-03-06T02:20:26+08:00
  • variantsobject[]
    商品款式列表。
  • barcode string
    款式的条形码。
    例子: T0000001
  • compare_at_price string
    款式的原价,数值保留到小数点后两位。
    例子: 129.99
  • id string
    款式的唯一标识 ID。
    例子: 18057850264851626133510282
  • imageobject
    款式的图片。
  • alt string
    款式图的替代文本描述,通常是具有图片特征或内容的单词或短语。
    例子: This is an image alt.
  • src string
    款式图的链接。
    例子: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • inventory_policy string
    款式的超卖策略。有效枚举值包含:
    • deny:不允许超卖。
    • continue:允许超卖。
  • inventory_quantity integer
    各存放地点的库存数量总和。
    例子: 99
  • inventory_tracker boolean
    表明是否开启库存追踪。
    • true:开启库存追踪。
    • false:不开启库存追踪。
  • option1 string
    款式第一个规格的信息。
    例子: red
  • option2 string
    款式第二个规格的信息。
    例子: xl
  • option3 string
    款式第三个规格的信息。
    例子: cotton
  • option4 string
    款式第四个规格的信息。
    例子: short
  • option5 string
    款式第五个规格的信息。
    例子: casual
  • price string
    款式的售价,数值保留到小数点后两位。
    例子: 90.22
  • product_id string
    款式对应商品的唯一标识 ID。
    例子: 16057850264845250791280282
  • required_shipping boolean
    表明款式是否需要运输。
    • true:需要运输。
    • false:不需要运输。
  • sku string
    商家为款式自定义的标识,区别于 SHOPLINE 生成的 variant.id。
    例子: S000000001
  • taxable boolean
    表明款式是否需要收税。
    • true:需要收税。
    • false:不需要收税。
  • title string
    款式的名称,由款式的规格值拼接而成。
    例子: red · xl
  • weight string
    款式的重量,超过两位小数向上取整。
    例子: 0.23
  • weight_unit string
    款式的重量单位。有效枚举值包含:
    • g:克
    • kg:千克
    • lb:磅
    • oz:盎司
    • zh_kg:公斤
  • vendor string
    商品的品牌或厂商。
    例子: SHOPLINE
状态码
收到 SHOPLINE 发送的 Webhook 通知后,你需要按照如下 SHOPLINE 要求的格式进行响应。
HTTP/1.1 200 OK
关于如何订阅 Webhooks 及更多 Webhook 响应规则说明,请参考 Webhook 概述。
这篇文章对你有帮助吗?