商品创建
事件分组 | 事件标识 |
---|---|
products | products/create |
执行商品创建后,你会接到此通知。你可以获得返回的商品创建信息。
关于如何订阅 Webhooks 及收到 Webhook 后该如何进行响应,请参考 Webhook 概述。
请求头
- X-Shopline-Topic string required事件操作标识Example:
orders/edited
- X-Shopline-Hmac-Sha256 string required签名Example:
XWmrwMey6OsLMeiZKwP4FppHH3cmAiiJJAweH5Jo4bM=
- X-Shopline-Shop-Domain string required店铺域名Example:
shophub.myshopline.com
- X-Shopline-Shop-Id string required店铺idExample:
1610418123456
- X-Shopline-Merchant-Id string required商户IDExample:
2000001234
- X-Shopline-API-Version string required版本号Example:
v20210901
- X-Shopline-Webhook-Id string required消息IDExample:
b54557e48a5fbf7d70bcd043
请求体
- body_html string商品描述。最大限制:512 kExample:
This is a description
- handle string商品的 handle,基于商品标题自动生成的唯一标识。Example:
spring-women's-clothing
- id string商品的唯一标识 ID。
最大长度限制:64Example:16058287356753569620272670
imageobject
商品的主图alt string用于分享图像的性质或内容的单词或短语。Example:This is a image alt
src string以 URL 形式表示的图像位置。Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
imagesobject[]
商品的图片列表。alt string用于分享图像的性质或内容的单词或短语。Example:This is a image alt
src string以 URL 形式表示的图像位置。Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
optionsobject[]
选项列表。id string选项的唯一标识 ID。Example:16158288104774469113452670
name string选项名称。Example:Color
option_valuesobject[]
选项值列表。id string选项值 ID。Example:16247051995358890915900034
value string选项值。Example:Red
product_id string商品的唯一标识 ID。
最大长度限制:64Example:16058287356753569620272670
values array选项值列表。与 option_values 返回数据一致,不包含选项值 ID。Example:["Red", "Green", "White"]
values_images map选项值对应的图片。Example:[object Object]
- product_behavior string商品行为Example:
RISK,HIDDEN
- product_category string商品类别。Example:
Electronic
- product_type string商品类型,有效枚举值包括:
- NORMAL:正常商品
- POD_TEMPORARY:POD临时商品
- TEMPORARY:临时商品
Example:Electronic
- published_scope string设置发布范围,值为
web
时表示在线商店。Example:web
- spu string商品的SPU码。Example:
S000001
- status string商品状态,有效枚举值包括:
- activated:上架
- deactivated:下架
- archived:归档
Example:active
- subtitle string商品的副标题。Example:
This is a subtitle
- tags string商品的标签。
最大数量限制:250
单字符串最大长度限制:255Example:tag1,tag2
- template_path string商品的主题模板。Example:
templates/products/detail.json
- title string商品的标题。
最大长度限制:255Example:spring women's clothing
variantsobject[]
商品款式列表barcode string条形码Example:B000000001
compare_at_price string商品变体的原价,价格数值保留到小数点后两位。Example:10
id string商品款式ID。Example:18054026339558906501791422
imageobject
商品变体的图片alt string用于分享图像的性质或内容的单词或短语。Example:This is a image alt
src string以 URL 形式表示的图像位置。Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
inventory_item_id string库存的唯一标识 ID。
最大长度限制:64Example:5482608456602009969
inventory_policy string超卖策略。- continue:在商品变体库存完全售空的情况下,客户无法继续订购
- deny:在商品变体库存完全售空的情况下,客户无法继续订购
默认值:denyExample:continue
inventory_quantity integer库存数量。Example:100
inventory_tracker boolean是否追踪库存。- true:启用追踪
- false:不启用追踪
默认值: falseExample:true
option1 string该款式对应的第一个选项的值。Example:Red
option2 string该款式对应的第二个选项的值Example:L
option3 string该款式对应的第三个选项的值option4 string该款式对应的第四个选项的值option5 string该款式对应的第五个选项的值price string商品变体的价格,价格数值保留到小数点后两位。Example:20
product_id string商品的唯一标识 ID。
最大长度限制:64Example:16058287356753569620272670
required_shipping boolean商品是否需要运输。- true:需要运输
- false:不需要运输
默认值: truesku string商品变体的SKU码Example:T000001
taxable boolean是否需要收税。- true:需要收税
- false:不需要收税
默认值: truetitle string商品变体的标题。Example:Red/L
weight string商品变体的重量(以 weight_unit 定义的单位表示)Example:10
weight_unit string重变体重量的测量单位。参数值 描述 g 表示单位克 kg 表示单位千克 lb 表示单位磅 oz 表示单位盎司 zh_kg 表示单位公斤 Example:g
- vendor string商品厂商Example:
Shopline
状态码
收到 SHOPLINE 发送的 Webhook 通知后,你需要按照如下 SHOPLINE 要求的格式进行响应。
HTTP/1.1 200 OK
关于如何订阅 Webhooks 及更多 Webhook 响应规则说明,请参考 Webhook 概述。
这篇文章对你有帮助吗?