跳到主要内容
版本:202201

创建子款式

POST 

/openapi/2022-01/products/:product_id/variants

根据提供的信息创建一个新的子款式。

请求

Path参数

    product_id string必填

    子款式所属的商品 ID。

请求体

    variant object
    option1string

    The first style value of the variant

    option2string

    The second style value of the variant

    option3string

    The second style value of the variant

    image_idstring
    compare_at_pricestring

    Variant original price, used for comparison with the actual price, can be converted to float64, supports only two decimal places

    pricestring

    Variant actual price, can be converted to float64, supports only two decimal places, set to "0.00" if price needs to be empty

    positionint32必填
    skustring
    barcodestring
    notestring
    inventory_quantityint32
    weightstring
    weight_unitstring

    Weight unit, supports kg, g, lb, oz

    cost_pricestring
    wholesale_price object[]
  • Array [
  • pricestring
    min_quantityint32

    Mini Order Quantity

  • ]

响应

200

数据结构
    variant object
    idstring
    示例: 1b735278-62c7-41ad-9976-b1b63a90590d
    product_idstring
    示例: 636a07da-39eb-4829-bde9-b65fae1c28b0
    image_idstring
    示例: 91d032e7-bbc8-47e4-8668-9ba6fe714de6
    created_atstring
    示例: 2024-04-15T02:00:57Z
    updated_atstring
    示例: 2024-04-15T02:00:57Z
    titlestring
    示例: S-red
    option1string
    示例: S
    option2string
    示例: red
    option3string
    示例:
    image object
    srcstring
    示例: //cdn.shoplazza.com/efd33b921cacd5311a32dd03a9bc8740.png
    widthinteger
    默认值: 0
    示例: 1588
    heightinteger
    默认值: 0
    示例: 2246
    pathstring
    示例: efd33b921cacd5311a32dd03a9bc8740.png
    altstring
    示例:
    positioninteger
    默认值: 0
    示例: 1
    compare_at_pricestring
    示例: 100.00
    pricestring
    示例: 100.00
    skustring
    示例: S-RED
    barcodestring
    示例: 123
    notestring
    示例: s-red
    inventory_quantityinteger
    默认值: 0
    示例: 10
    weightstring
    示例: 0.10
    weight_unitstring
    示例: kg
    cost_pricestring
    示例: 11.00
    wholesale_price object[]
  • Array [
  • pricestring
    示例: 100.00
    min_quantityinteger
    默认值: 0
    示例: 1
  • ]
  • extend