更新商品
PUT https://{handle}.myshopline.com/admin/openapi/v20230301/products/:product_id.json
handle
:店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com
的店铺,其 handle
是 open001
。更新商品
路径参数
- product_id string required商品ID,限制64个字符Example:
16050375155238626683133099
请求头
- Content-Type required字段值固定为
application/json; charset=utf-8
- Authorization string required资源的访问令牌。请参考 应用授权 获取访问令牌,然后将获取到的访问令牌以 Bearer 格式传入Example:
Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw
请求体
productobject
商品信息body_html string商品描述,限制512kExample:This is a description
handle string全局唯一的商品handle,默认商品标题,限制255个字符Example:product-handle
imagesobject[]
商品主图,最多500张alt string图片的alt信息,限制255个字符Example:This is a image alt
id string图片IDExample:5759070976424132652
src string对应的图片链接,限制255个字符Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
optionsobject[]
选项集合,最多5个name string选项名称,限制255个字符Example:Color
values_images map选项值图Example:[object Object]
product_category string产品类别Example:Electronic
published_scope string设置发布范围,值为「web」时表示在线商店Example:web
spu stringSPU码,限制255个字符Example:S0000001
status string商品状态:active - 上架,draft - 下架,archived - 归档Example:active
subtitle string商品摘要,限制400个字符Example:This is a subtitle
tags array商品标签,最多250个标签,每个标签长度限制最大255Example:tag1,tag2
title string商品标题,限制255个字符Example:This is a title
variantsobject[]
商品款式,最多500个barcode string条形码,限制255个字符Example:B0000001
compare_at_price string原价,默认为空Example:11
id string款式IDExample:18050375907221969070393099
imageobject
款式图alt string图片的alt信息,限制255个字符Example:This is a image alt
id string图片IDExample:5759070976424132652
src string对应的图片链接,限制255个字符Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
inventory_policy string超卖策略:deny - 不允许超卖,continue - 允许超卖Example:deny
inventory_tracker boolean是否追踪库存,默认为不追踪Example:true
option1 string该款式对应的第一个选项的值,限制255个字符Example:Red
option2 string该款式对应的第二个选项的值,限制255个字符Example:L
option3 string该款式对应的第三个选项的值,限制255个字符option4 string该款式对应的第四个选项的值,限制255个字符option5 string该款式对应的第五个选项的值,限制255个字符price string售价,默认为0Example:10.11
required_shipping boolean是否需要发货Example:true
sku stringSKU码,限制255个字符Example:2111341123434
taxable boolean是否需要收税Example:true
weight string重量,要求大于0,超过两位小数向上取整Example:1.2
weight_unit string重量单位:g, kg, lb, oz, zh_kgExample:kg
vendor string厂商名称,限制255个字符Example:Shopline
响应
- 200
- 401
- 429
更多状态码信息请参考 HTTP 状态码
响应头
traceId
traceId
响应体
productobject
商品对象body_html string商品描述Example:This is a description
created_at string创建时间Example:2021-09-02T14:11:54+00:00
handle string全局唯一的商品handleExample:product-handle
id string商品IDExample:16050375155238626683133099
imageobject
商品主图alt string图片alt信息Example:This is a image alt
id string图片IDExample:5759070976424132652
src string对应的图片链接Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
imagesobject[]
商品图片列表alt string图片alt信息Example:This is a image alt
id string图片IDExample:5759070976424132652
src string对应的图片链接Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
optionsobject[]
选项集合,最多5个id string选项IDExample:16150375907221969070413099
name string选项名称Example:Color
product_id string商品IDExample:16050375155238626683133099
values array选项值列表Example:["Red", "Green", "White"]
values_images map选项值图Example:[object Object]
product_behavior string商品行为product_category string产品类别Example:Electronic
product_type string商品类型:NORMAL - 正常商品,POD_TEMPORARY - POD临时商品,TEMPORARY - 临时商品Example:NORMAL
published_at string发布到在线商店的时间Example:2021-09-02T14:11:54+00:00
published_scope string发布范围,值为「web」时表示在线商店Example:web
spu stringSPUExample:S0000000001
status string商品状态:active - 上架,draft - 下架,archived - 归档Example:active
subtitle string商品摘要Example:This is a subtitle
tags string商品标签Example:tag1,tag2
template_path string主题模板title string商品标题Example:This is a title
updated_at string更新时间Example:2021-09-02T14:11:54+00:00
variantsobject[]
商品款式barcode string条形码Example:B0000000001
compare_at_price string原价Example:11
created_at string创建时间Example:2021-09-02T14:11:54+00:00
id string款式IDExample:18050375907221969070393099
imageobject
款式图alt string图片alt信息Example:This is a image alt
id string图片IDExample:5759070976424132652
src string对应的图片链接Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
inventory_item_id string库存对象IDExample:5785060242375689228
inventory_policy string超卖策略:deny - 不允许超卖,continue - 允许超卖Example:deny
inventory_quantity integer所有地点的库存数量汇总Example:99
inventory_tracker boolean是否追踪库存Example:true
option1 string该款式对应的第一个选项的值Example:Red
option2 string该款式对应的第二个选项的值Example:L
option3 string该款式对应的第三个选项的值option4 string该款式对应的第四个选项的值option5 string该款式对应的第五个选项的值price string售价Example:10.11
product_id string商品IDExample:16050375155238626683133099
required_shipping boolean是否需要发货Example:true
sku stringSKU码Example:2111341123434
taxable boolean是否需要收税Example:true
title string款式标题Example:Red/L
updated_at string更新时间Example:2021-09-02T14:11:54+00:00
weight string重量Example:1.2
weight_unit string重量单位:g , kg , lb , oz , zh_kgExample:kg
vendor string商品厂商Example:Shopline
API Explorer
调试台
示例代码
这篇文章对你有帮助吗?
Error loading component.