更新商品
PUT https://{handle}.myshopline.com/admin/openapi/v20220601/products/:product_id.json
handle
:店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com
的店铺,其 handle
是 open001
。增量更新商品接口
路径参数
- product_id string required商品ID,限制64个字符
请求头
- 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商品描述,限制128kExample:这是商品描述
brand string品牌名称,限制64个字符Example:优衣库
handle string全局唯一的商品handle,默认商品标题,限制255个字符Example:t-shirt
imagesobject[]
商品主图,最多40张alt string图片的alt信息,限制255个字符Example:这是图片ALT
src string对应的图片src链接,限制255个字符Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
optionsobject[]
属性集合,最多5个Optionname string属性名称,限制50个字符Example:颜色
values_images map规格值图,例如:{ "red" : "src" }Example:[object Object]
published_scope string设置发布范围,值为「web」时表示在线商店status string商品上下架状态:active,draft,archivedExample:active
subtitle string商品摘要,限制255个字符Example:这是副标题
tags array商品标签,最多60个标签,每个标签限制100个字符Example:衣服,T恤
title string商品标题,限制255个字符Example:联名T恤
variantsobject[]
商品规格,最多500个barcode string条形码,限制100个字符Example:1111111123434
compare_at_price string原价,默认为空Example:11
id string商品变种IDExample:18050375907221969070393099
imageobject
商品变种的属性图alt string图片的alt信息,限制255个字符Example:这是图片ALT
src string对应的图片src链接,限制255个字符Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
inventory_policy string超卖策略:不允许超卖(deny),允许超卖(continue)Example:deny
inventory_quantity integer库存数,最小值-999999,最大值999999Example:11
inventory_tracker boolean追踪库存:true,不追踪库存:false,默认为不追踪Example:true
option1 string该SKU对应的option1的值,限制255个字符Example:红色
option2 string该SKU对应的option2的值,限制255个字符option3 string该SKU对应的option3的值,限制255个字符option4 string该SKU对应的option4的值,限制255个字符option5 string该SKU对应的option5的值,限制255个字符price string售价,默认为0Example:10.11
sku stringSKU码,限制100个字符Example:2111341123434
weight string重量,要求大于0,超过两位小数向上取整Example:1.2
weight_unit string重量单位:g, kg, lb, ozExample:kg
响应
- 200
- 401
- 429
更多状态码信息请参考 HTTP 状态码
响应头
traceId
traceId
响应体
productobject
商品对象body_html string商品描述Example:这是商品描述
brand string商品品牌Example:优衣库
created_at string创建时间Example:2021-09-02T14:11:54+00:00
handle string全局唯一的商品handleExample:t-shirt
id string商品IDExample:16050375155238626683133099
imageobject
商品主图alt string图片alt信息Example:这是图片ALT
src string对应的图片src链接Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
imagesobject[]
商品图片列表alt string图片alt信息Example:这是图片ALT
src string对应的图片src链接Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
optionsobject[]
属性集合,最多5个Optionid string属性名IDExample:16150375907221969070413099
name string属性名称Example:颜色
product_id string商品IDExample:16050375155238626683133099
values array属性值列表,不能超过50个Example:红色
values_images map规格值图,例如:{ "red" : "src" }Example:[object Object]
product_behavior string商品行为product_type string商品类型:NORMAL-正常商品,POD_TEMPORARY-POD临时商品,TEMPORARY-临时商品published_at string发布时间published_scope string发布范围,值为「web」时表示在线商店status string商品上下架状态:active,draft,archivedExample:active
subtitle string商品摘要Example:这是副标题
tags string商品标签Example:衣服,T恤
template_path string主题模板title string商品标题Example:联名T恤
updated_at string更新时间Example:2021-09-02T14:11:54+00:00
variantsobject[]
商品规格,最多500个barcode string条形码Example:1111111123434
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:这是图片ALT
src string对应的图片src链接Example:https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
inventory_item_id string库存对象IDinventory_policy string超卖策略:不允许超卖(deny),允许超卖(continue)Example:deny
inventory_quantity integer库存数,最小值-999999,最大值999999Example:11
inventory_tracker boolean追踪库存:true,不追踪库存:false,默认为不追踪Example:true
option1 string该SKU对应的option1的值Example:红色
option2 string该SKU对应的option2的值option3 string该SKU对应的option3的值option4 string该SKU对应的option4的值option5 string该SKU对应的option5的值price string售价Example:10.11
product_id string商品IDExample:16050375155238626683133099
sku stringSKU码Example:2111341123434
title string商品变种标题Example:颜色·红色
updated_at string更新时间Example:2021-09-02T14:11:54+00:00
weight string重量Example:1.2
weight_unit string重量单位Example:kg
API Explorer
调试台
示例代码
这篇文章对你有帮助吗?
Error loading component.