跳到主要内容
版本:202701

查询商品定制配置

GET 

/openapi/2027-01/customization/products/:product_id/design

返回某商品的定制配置,包含定制项、分组与展示规则。

请求​

Path参数

    product_id string必填

    SaaS 商品 ID

响应​

OK

数据结构
    codestring

    错误码

    messagestring

    错误信息

    data object
    design object

    商品定制配置

    product_idstring

    SaaS 商品 ID

    typestring

    配置类型:normal / linked(只读)

    applied_template_idstring

    来源模板 ID,未套用模板时为空

    components object[]

    定制项

  • Array [
  • keystring

    定制项标识,格式 {type}-{8位},同一配置内唯一

    typestring

    定制项类型:text / dropdown / checkbox / button / image / upload / datetime / size-pricing / preview-*

    settingsobject

    定制项设置。通用字段:label(必填,同商品内唯一)、order_label、required、support_condition、value、options[]; options[]:key(选项标识,ERP 匹配用)、label、value、imageUrl、price、link、children、parentKey;其余字段按 type 而定

    price_settings object

    该定制项的加价规则

    calc_typestring

    计算方式:component / option / bysize / formula

    price object

    价格表。calc_type=component 时 key 为定制项 key,option 时为选项 key,bysize 时为尺寸 key

    property name*double
    settingsobject

    附加设置,calc_type=formula 时含 formula

  • ]
  • groups object[]

    定制项分组

  • Array [
  • keystring

    分组标识

    group_namestring

    分组展示名

    containsstring[]

    该分组包含的定制项 key

    typestring

    分组类型:material(每个定制项默认的包裹组,key 与定制项相同)/ group(自定义分组,key 形如 group-xxxxxxxx)

  • ]
  • conditions object[]

    链式展示规则

  • Array [
  • rulesobject

    {items: [{type: custom/product, left, right: []}], logic: and/or}。custom:left 为定制项 key, right 为选项 key;product:left 为规格名,right 为规格值

    targetsstring[]

    要显示的定制项或分组 key

  • ]
  • with_previewint32

    预览模式:0-仅选项,1-带预览

    preview_settings object

    预览设置,with_preview=1 时有值

    physical_sizeobject

    {width, height, unit, dpi}

    background_imagesobject

    {[saas_variant_id]: {image: {src, width, height}}}

    print_design_boundingobject

    {[saas_variant_id]: {top, left, width, height, angle, scaleX, scaleY}}

    layersGoogleProtobufValue

    图层定义

    artwork_image object

    效果图

    srcstring

    图片地址

    widthint32

    图片宽度(像素)

    heightint32

    图片高度(像素)