需要 write_products 权限点。
更多权限点使用信息,请参考:
PUT https://{handle}.myshopline.com/admin/openapi/v20220901/products/:product_id.json
handle :店铺的唯一标识符,值为店铺域名的前缀。例如,域名为 open001.myshopline.com 的店铺,其 handleopen001
增量更新商品接口
路径参数
  • 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
    商品描述,限制128k
    Example: 这是商品描述
  • 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个Option
  • name string
    属性名称,限制50个字符
    Example: 颜色
  • values_images map
    规格值图,例如:{ "red" : "src" }
    Example: [object Object]
  • product_category string
    产品类型
  • published_scope string
    设置发布范围,值为「web」时表示在线商店
  • status string
    商品上下架状态:active,draft,archived
    Example: 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
    商品变种ID
    Example: 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_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
    售价,默认为0
    Example: 10.11
  • required_shipping boolean
    是否需要发货
  • sku string
    SKU码,限制100个字符
    Example: 2111341123434
  • taxable boolean
    是否需要收税
  • weight string
    重量,要求大于0,超过两位小数向上取整
    Example: 1.2
  • weight_unit string
    重量单位:g, kg, lb, oz
    Example: kg
响应
更多状态码信息请参考 HTTP 状态码

响应头
  • traceId
    traceId
响应体
  • productobject
    商品对象
  • body_html string
    商品描述
    Example: 这是商品描述
  • brand string
    商品品牌
    Example: 优衣库
  • created_at string
    创建时间
    Example: 2021-09-02T14:11:54+00:00
  • handle string
    全局唯一的商品handle
    Example: t-shirt
  • id string
    商品ID
    Example: 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个Option
  • id string
    属性名ID
    Example: 16150375907221969070413099
  • name string
    属性名称
    Example: 颜色
  • product_id string
    商品ID
    Example: 16050375155238626683133099
  • values array
    属性值列表,不能超过50个
    Example: 红色
  • values_images map
    规格值图,例如:{ "red" : "src" }
    Example: [object Object]
  • product_behavior string
    商品行为
  • product_category string
    产品类型
  • product_type string
    商品类型:NORMAL-正常商品,POD_TEMPORARY-POD临时商品,TEMPORARY-临时商品
  • published_at string
    发布时间
  • published_scope string
    发布范围,值为「web」时表示在线商店
  • status string
    商品上下架状态:active,draft,archived
    Example: 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
    商品变种ID
    Example: 18050375907221969070393099
  • imageobject
    商品变种的属性图
  • alt string
    图片alt信息
    Example: 这是图片ALT
  • src string
    对应的图片src链接
    Example: https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png
  • inventory_item_id string
    库存对象ID
  • inventory_policy string
    超卖策略:不允许超卖(deny),允许超卖(continue)
    Example: deny
  • inventory_quantity integer
    所有地点的库存数量汇总,不超过7个9
  • 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
    商品ID
    Example: 16050375155238626683133099
  • required_shipping boolean
    是否需要发货
  • sku string
    SKU码
    Example: 2111341123434
  • taxable boolean
    是否需要收税
  • 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
https://openapiceshidianpu.myshopline.com/admin/openapi/v20220901

ParamOptions

— path required
— header required

Body

required
{
  "product": {
    "body_html": "这是商品描述",
    "brand": "优衣库",
    "handle": "t-shirt",
    "images": [
      {
        "alt": "这是图片ALT",
        "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
      }
    ],
    "options": [
      {
        "name": "颜色",
        "values_images": {}
      }
    ],
    "product_category": "",
    "published_scope": "",
    "status": "active",
    "subtitle": "这是副标题",
    "tags": [
      "衣服,T恤"
    ],
    "title": "联名T恤",
    "variants": [
      {
        "barcode": "1111111123434",
        "compare_at_price": "11",
        "id": "18050375907221969070393099",
        "image": {
          "alt": "这是图片ALT",
          "src": "https://img.myshopline.com/image/official/e46e6189dd5641a3b179444cacdcdd2a.png"
        },
        "inventory_policy": "deny",
        "inventory_tracker": true,
        "option1": "红色",
        "option2": "",
        "option3": "",
        "option4": "",
        "option5": "",
        "price": "10.11",
        "required_shipping": false,
        "sku": "2111341123434",
        "taxable": false,
        "weight": "1.2",
        "weight_unit": "kg"
      }
    ]
  }
}

Language

curl --request PUT \
--url https://openapiceshidianpu.myshopline.com/admin/openapi/v20220901/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'
这篇文章对你有帮助吗?

Error loading component.

Error loading component.