跳到主要内容
版本:202701

查询定制模板详情

GET 

/openapi/2027-01/customization/templates/:id

返回单个定制模板的详情,包含定制项、分组与展示规则。

请求​

Path参数

    id string必填

    模板 ID

响应​

OK

数据结构
    codestring

    错误码

    messagestring

    错误信息

    data object
    template object

    模板详情

    idstring

    模板 ID

    namestring

    模板名称

    with_previewint32

    预览模式:0-仅选项,1-带预览,2-带效果图

    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

  • ]
  • preview_settings object

    预览设置,with_preview 为 1/2 时有值

    physical_sizeobject

    {width, height, unit: mm/inch/px, dpi}

    layersGoogleProtobufValue

    图层定义

    artwork_image object

    效果图

    srcstring

    图片地址

    widthint32

    图片宽度(像素)

    heightint32

    图片高度(像素)