需要 write_products 权限点。
更多权限点使用信息,请参考:
PUT https://{handle}.myshopline.com/admin/openapi/v20250601/products/:product_id.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
更新商品
路径参数
  • 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
    商品描述,限制512k
    Example: This is a description
  • handle string
    全局唯一的商品handle,默认商品标题,限制255个字符
    Example: a-product-title
  • imagesobject[]
    商品图片列表,最多502张
  • alt string
    具有图像特征或内容的单词或短语,限制512个字符
    Example: This is a image alt
  • id string
    图片ID
    Example: 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]
  • path string
    在线商店中商品URL的相对路径,最多512个字符。
    Example: /my_product
  • product_category string
    产品类别
    Example: Electronic
  • published_scope string
    发布范围,值为web时表示在线商店
    Example: web
  • spu string
    商品的SPU码,限制255个字符
    Example: S000001
  • status string
    商品状态:
    参数值描述
    active表示产品已准备好销售,可以在应用程序和销售渠道上发布
    draft该产品尚未准备好销售,无法通过应用程序和销售渠道向客户提供
    archived表示该产品不用于销售,不能通过应用程序和销售渠道提供给客户
    Example: active
  • subtitle string
    商品摘要,限制400个字符
    Example: This is a subtitle
  • tags array
    商品标签,最多250个标签,每个标签长度限制最大255
    Example: tag1, tag2
  • title string
    商品标题,限制255个字符
    Example: A product title
  • variantsobject[]
    归属于商品的变体,最多500个
  • barcode string
    变体的条形码,限制255个字符
    Example: B000000001
  • compare_at_price string
    变体的原价,默认为空
    Example: 11.2
  • id string
    变体的ID
    Example: 18050375907221969070393099
  • imageobject
    变体的图片
  • alt string
    具有图像特征或内容的单词或短语,限制512个字符
    Example: This is a image alt
  • id string
    图片ID
    Example: 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
    变体的价格,默认为0
    Example: 10.11
  • required_shipping boolean
    表明是否需要发货
    Example: true
  • sku string
    SKU码,限制255个字符
    Example: T0000000001
  • taxable boolean
    表明是否需要收税
    Example: true
  • weight string
    变体的重量,要求大于0,超过两位小数向上取整
    Example: 1.2
  • weight_unit string
    变体重量的测量单位。如果未指定 weight_unit,则将应用商店的默认测量单位
    Example: kg
  • vendor string
    厂商名称,限制255个字符
    Example: Shopline
响应
更多状态码信息请参考 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
    全局唯一的商品handle
    Example: a-product-title
  • id string
    商品ID
    Example: 16050375155238626683133099
  • imageobject
    商品主图
  • alt string
    具有图像特征或内容的单词或短语
    Example: This is a image alt
  • id string
    图片ID
    Example: 5759070976424132652
  • src string
    对应的图片链接
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • imagesobject[]
    商品图片列表
  • alt string
    具有图像特征或内容的单词或短语
    Example: This is a image alt
  • id string
    图片ID
    Example: 5759070976424132652
  • src string
    对应的图片链接
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • optionsobject[]
    选项集合,最多5个
  • id string
    选项ID
    Example: 16150375907221969070413099
  • name string
    选项名称
    Example: Color
  • product_id string
    商品ID
    Example: 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
    • TEMPORARY
    Example: NORMAL
  • published_at string
    发布到在线商店的时间
    Example: 2021-09-02T14:11:54+00:00
  • published_scope string
    发布范围,值为web时表示在线商店
    Example: web
  • spu string
    商品的SPU码
    Example: S000001
  • status string
    商品状态:
    参数值描述
    active表示产品已准备好销售,可以在应用程序和销售渠道上发布
    draft该产品尚未准备好销售,无法通过应用程序和销售渠道向客户提供
    archived表示该产品不用于销售,不能通过应用程序和销售渠道提供给客户
    Example: active
  • subtitle string
    商品摘要
    Example: This is a subtitle
  • tags string
    商品标签
    Example: tag1, tag2
  • template_path string
    主题模板
    Example: templates/product.json
  • title string
    商品标题
    Example: A product title
  • updated_at string
    最后修改的日期和时间
    Example: 2021-09-02T14:11:54+00:00
  • variantsobject[]
    归属于商品的变体
  • barcode string
    条形码
    Example: B000000001
  • compare_at_price string
    原价
    Example: 11.2
  • created_at string
    创建时间
    Example: 2021-09-02T14:11:54+00:00
  • id string
    商品变体ID
    Example: 18050375907221969070393099
  • imageobject
    变体的图片
  • alt string
    具有图像特征或内容的单词或短语
    Example: This is a image alt
  • id string
    图片ID
    Example: 5759070976424132652
  • src string
    对应的图片链接
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • inventory_item_id string
    库存对象ID
  • 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
    商品ID
    Example: 16050375155238626683133099
  • required_shipping boolean
    表明是否需要发货
    Example: true
  • sku string
    SKU码
    Example: T0000000001
  • 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
    变体重量的测量单位
    Example: kg
  • vendor string
    商品厂商
    Example: Shopline
API Explorer
https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601

ParamOptions

path required
header required

Body

required
{
  "product": {
    "body_html": "This is a description",
    "handle": "a-product-title",
    "images": [
      {
        "alt": "This is a image alt",
        "id": "5759070976424132652",
        "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
      }
    ],
    "options": [
      {
        "name": "Color",
        "values_images": {}
      }
    ],
    "path": "/my_product",
    "product_category": "Electronic",
    "published_scope": "web",
    "spu": "S000001",
    "status": "active",
    "subtitle": "This is a subtitle",
    "tags": [
      "tag1, tag2"
    ],
    "title": "A product title",
    "variants": [
      {
        "barcode": "B000000001",
        "compare_at_price": "11.2",
        "id": "18050375907221969070393099",
        "image": {
          "alt": "This is a image alt",
          "id": "5759070976424132652",
          "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
        },
        "inventory_policy": "deny",
        "inventory_tracker": true,
        "option1": "Red",
        "option2": "L",
        "option3": "",
        "option4": "",
        "option5": "",
        "price": "10.11",
        "required_shipping": true,
        "sku": "T0000000001",
        "taxable": true,
        "weight": "1.2",
        "weight_unit": "kg"
      }
    ],
    "vendor": "Shopline"
  }
}

Language

curl --request PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20250601/products/product_id.json \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJhcHBLZXkiOiJmMjM3OWQyMTYyOGMzM2QxMWRiMWZkYjY5N2EzZjdjMjZlNGMwYTA5Iiwic2VsbGVySWQiOiIyMDAwMjM0ODgwIiwic3RvcmVJZCI6IjE2NzIzNjk3Mjk2MDYiLCJ2ZXJzaW9uIjoiVjIiLCJkb21haW4iOiJodHRwczovL3NsLW9wZW4tc2cubXlzaG9wbGluZS5jb20iLCJ0aW1lc3RhbXAiOjE2NzUzMTk0OTI0MzksImlzcyI6Inlzb3VsIiwiZXhwIjoxNzY5OTI3NDkyfQ.UwQzomM2veGCUaOZ0paUxq5dpc7DXuhHYFvsQ_uIAKduzWcb_j2E4q_36El83sp145D4cKbpcE5KCeeIz-JNQw' \
--header 'Content-Type: application/json; charset=utf-8' \
--header 'accept: application/json' \
--data '
{
"product": {
"body_html": "This is a description",
"handle": "a-product-title",
"images": [
{
"alt": "This is a image alt",
"id": "5759070976424132652",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
}
],
"options": [
{
"name": "Color",
"values_images": {}
}
],
"path": "/my_product",
"product_category": "Electronic",
"published_scope": "web",
"spu": "S000001",
"status": "active",
"subtitle": "This is a subtitle",
"tags": [
"tag1, tag2"
],
"title": "A product title",
"variants": [
{
"barcode": "B000000001",
"compare_at_price": "11.2",
"id": "18050375907221969070393099",
"image": {
"alt": "This is a image alt",
"id": "5759070976424132652",
"src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
},
"inventory_policy": "deny",
"inventory_tracker": true,
"option1": "Red",
"option2": "L",
"option3": "",
"option4": "",
"option5": "",
"price": "10.11",
"required_shipping": true,
"sku": "T0000000001",
"taxable": true,
"weight": "1.2",
"weight_unit": "kg"
}
],
"vendor": "Shopline"
}
}
'
这篇文章对你有帮助吗?

Error loading component.

Error loading component.