创建价格规则
POST/openapi/2025-06/price_rules
为店铺创建新的折扣或促销价格规则。
请求
- application/json
- 请求体
- 示例
请求体必填
- Array [
- ]
- Array [
- ]
price_rule object
价格规则
该价格规则的标题
该折扣的折扣值
折扣类型。选项:fixed_amount 为固定金额折扣,percentage 为百分比折扣
使用次数限制,-1 表示无限制
结账兑换次数限制:0~999,0 表示仅允许兑换一次,999 表示无限制
每位顾客的最大使用次数,-1 或 0 表示无限制
此折扣是否有前提条件(1 为是,0 为否)
该折扣允许的目标商品,选项:all 为所有商品,entitled 为指定商品
该折扣的目标类型
折扣开始时间,格式:YYYY-MM-DDTHH:mm:ssZ
折扣结束时间,格式:YYYY-MM-DDTHH:mm:ssZ
指定价格规则允许的商品 ID,仅当 target_selection 为 entitled 时必填
指定价格规则允许的商品规格 ID
指定折扣允许的集合
prerequisite_subtotal_range object[]
折扣触发的金额前提条件
指定价格须大于或等于的值
值
百分比值
值事件类型
值条件
目标类型
目标数据
prerequisite_quantity_range object[]
折扣触发的商品数量前提条件
指定价格须大于或等于的值
值
百分比值
值事件类型
值条件
目标类型
目标数据
{
"price_rule": {
"title": "string",
"value": 0,
"value_type": "string",
"usage_limit": 0,
"allocation_limit": 0,
"once_per_customer": 0,
"prerequisite": 0,
"target_selection": "string",
"target_type": "string",
"starts_at": "string",
"ends_at": "string",
"entitled_product_ids": [
"string"
],
"entitled_variant_ids": [
"string"
],
"entitled_collection_ids": [
"string"
],
"prerequisite_subtotal_range": [
{
"greater_than_or_equal_to": "string",
"value": "string",
"value_percentage": "string",
"value_event_type": "string",
"value_condition": "string",
"target_type": "string",
"target_data": [
"string"
]
}
],
"prerequisite_quantity_range": [
{
"greater_than_or_equal_to": "string",
"value": "string",
"value_percentage": "string",
"value_event_type": "string",
"value_condition": "string",
"target_type": "string",
"target_data": [
"string"
]
}
]
}
}
响应
- 200
OK
- application/json
- 数据结构
- 示例
数据结构
- Array [
- ]
- Array [
- ]
- Array [
- ]
错误码
错误信息
data object
price_rule object
价格规则
价格规则 ID
标题
值
值类型
使用次数上限,-1 表示无限制
已使用次数
分配方式
分配上限
分配上限金额
是否每位顾客只能使用一次
前提条件
顾客筛选条件
目标选择
目标类型
目标价格类型
创建时间,ISO-8601 格式
最后更新时间,ISO-8601 格式
开始时间
结束时间
前提条件顾客 ID 列表
顾客分组前提条件 ID 列表
授权商品 ID 列表
授权规格 ID 列表
授权过滤 ID 列表
授权过滤列表
规格所属商品 ID 列表
授权集合 ID 列表
entitled_area_list object[]
授权地区列表
国家代码(如 CN)
省份代码列表
prerequisite_subtotal_range object[]
小计前提条件范围
大于或等于的值
值
百分比值
值事件类型
值条件
目标类型
目标数据
prerequisite_quantity_range object[]
数量前提条件范围
大于或等于的值
值
百分比值
值事件类型
值条件
目标类型
目标数据
{
"code": "string",
"message": "string",
"data": {
"price_rule": {
"id": "string",
"title": "string",
"value": 0,
"value_type": "string",
"usage_limit": 0,
"times_used": 0,
"allocation_method": "string",
"allocation_limit": 0,
"allocation_limit_amount": 0,
"once_per_customer": 0,
"prerequisite": 0,
"customer_selection": "string",
"target_selection": "string",
"target_type": "string",
"target_price_type": "string",
"created_at": "string",
"updated_at": "string",
"starts_at": "string",
"ends_at": "string",
"prerequisite_customer_ids": [
"string"
],
"prerequisite_customer_segment_ids": [
"string"
],
"entitled_product_ids": [
"string"
],
"entitled_variant_ids": [
"string"
],
"entitled_filter_ids": [
"string"
],
"entitled_filter_list": [
"string"
],
"variant_product_ids": [
"string"
],
"entitled_collection_ids": [
"string"
],
"entitled_area_list": [
{
"country_code": "string",
"province_codes": [
"string"
]
}
],
"prerequisite_subtotal_range": [
{
"greater_than_or_equal_to": "string",
"value": "string",
"value_percentage": "string",
"value_event_type": "string",
"value_condition": "string",
"target_type": "string",
"target_data": [
"string"
]
}
],
"prerequisite_quantity_range": [
{
"greater_than_or_equal_to": "string",
"value": "string",
"value_percentage": "string",
"value_event_type": "string",
"value_condition": "string",
"target_type": "string",
"target_data": [
"string"
]
}
]
}
}
}