查询商品定制配置
GET/openapi/2027-01/customization/products/:product_id/design
返回某商品的定制配置,包含定制项、分组与展示规则。
请求
Path参数
SaaS 商品 ID
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
- Array [
- ]
- Array [
- ]
- Array [
- ]
错误码
错误信息
data object
design object
商品定制配置
SaaS 商品 ID
配置类型:normal / linked(只读)
来源模板 ID,未套用模板时为空
components object[]
定制项
定制项标识,格式 {type}-{8位},同一配置内唯一
定制项类型:text / dropdown / checkbox / button / image / upload / datetime / size-pricing / preview-*
定制项设置。通用字段:label(必填,同商品内唯一)、order_label、required、support_condition、value、options[]; options[]:key(选项标识,ERP 匹配用)、label、value、imageUrl、price、link、children、parentKey;其余字段按 type 而定
price_settings object
该定制项的加价规则
计算方式:component / option / bysize / formula
price object
价格表。calc_type=component 时 key 为定制项 key,option 时为选项 key,bysize 时为尺寸 key
附加设置,calc_type=formula 时含 formula
groups object[]
定制项分组
分组标识
分组展示名
该分组包含的定制项 key
分组类型:material(每个定制项默认的包裹组,key 与定制项相同)/ group(自定义分组,key 形如 group-xxxxxxxx)
conditions object[]
链式展示规则
{items: [{type: custom/product, left, right: []}], logic: and/or}。custom:left 为定制项 key, right 为选项 key;product:left 为规格名,right 为规格值
要显示的定制项或分组 key
预览模式:0-仅选项,1-带预览
preview_settings object
预览设置,with_preview=1 时有值
{width, height, unit, dpi}
{[saas_variant_id]: {image: {src, width, height}}}
{[saas_variant_id]: {top, left, width, height, angle, scaleX, scaleY}}
图层定义
artwork_image object
效果图
图片地址
图片宽度(像素)
图片高度(像素)
{
"code": "string",
"message": "string",
"data": {
"design": {
"product_id": "string",
"type": "string",
"applied_template_id": "string",
"components": [
{
"key": "string",
"type": "string",
"settings": {},
"price_settings": {
"calc_type": "string",
"price": {},
"settings": {}
}
}
],
"groups": [
{
"key": "string",
"group_name": "string",
"contains": [
"string"
],
"type": "string"
}
],
"conditions": [
{
"rules": {},
"targets": [
"string"
]
}
],
"with_preview": 0,
"preview_settings": {
"physical_size": {},
"background_images": {},
"print_design_bounding": {},
"artwork_image": {
"src": "string",
"width": 0,
"height": 0
}
}
}
}
}