跳到主要内容
版本:202506

创建价格规则

POST 

/openapi/2025-06/price_rules

为店铺创建新的折扣或促销价格规则。

请求

请求体必填

    price_rule object

    价格规则

    titlestring必填

    该价格规则的标题

    valuefloat必填

    该折扣的折扣值

    value_typestring必填

    折扣类型。选项:fixed_amount 为固定金额折扣,percentage 为百分比折扣

    usage_limitint32

    使用次数限制,-1 表示无限制

    allocation_limitint32

    结账兑换次数限制:0~999,0 表示仅允许兑换一次,999 表示无限制

    once_per_customerint32

    每位顾客的最大使用次数,-1 或 0 表示无限制

    prerequisiteint32

    此折扣是否有前提条件(1 为是,0 为否)

    target_selectionstring必填

    该折扣允许的目标商品,选项:all 为所有商品,entitled 为指定商品

    target_typestring

    该折扣的目标类型

    starts_atstring必填

    折扣开始时间,格式:YYYY-MM-DDTHH:mm:ssZ

    ends_atstring必填

    折扣结束时间,格式:YYYY-MM-DDTHH:mm:ssZ

    entitled_product_idsstring[]

    指定价格规则允许的商品 ID,仅当 target_selection 为 entitled 时必填

    entitled_variant_idsstring[]

    指定价格规则允许的商品规格 ID

    entitled_collection_idsstring[]

    指定折扣允许的集合

    prerequisite_subtotal_range object[]

    折扣触发的金额前提条件

  • Array [
  • greater_than_or_equal_tostring

    指定价格须大于或等于的值

    valuestring

    value_percentagestring

    百分比值

    value_event_typestring

    值事件类型

    value_conditionstring

    值条件

    target_typestring

    目标类型

    target_datastring[]

    目标数据

  • ]
  • prerequisite_quantity_range object[]

    折扣触发的商品数量前提条件

  • Array [
  • greater_than_or_equal_tostring

    指定价格须大于或等于的值

    valuestring

    value_percentagestring

    百分比值

    value_event_typestring

    值事件类型

    value_conditionstring

    值条件

    target_typestring

    目标类型

    target_datastring[]

    目标数据

  • ]

响应

OK

数据结构
    codestring

    错误码

    messagestring

    错误信息

    data object
    price_rule object

    价格规则

    idstring

    价格规则 ID

    titlestring

    标题

    valuefloat

    value_typestring

    值类型

    usage_limitint32

    使用次数上限,-1 表示无限制

    times_usedint32

    已使用次数

    allocation_methodstring

    分配方式

    allocation_limitint32

    分配上限

    allocation_limit_amountfloat

    分配上限金额

    once_per_customerint32

    是否每位顾客只能使用一次

    prerequisiteint32

    前提条件

    customer_selectionstring

    顾客筛选条件

    target_selectionstring

    目标选择

    target_typestring

    目标类型

    target_price_typestring

    目标价格类型

    created_atstring

    创建时间,ISO-8601 格式

    updated_atstring

    最后更新时间,ISO-8601 格式

    starts_atstring

    开始时间

    ends_atstring

    结束时间

    prerequisite_customer_idsstring[]

    前提条件顾客 ID 列表

    prerequisite_customer_segment_idsstring[]

    顾客分组前提条件 ID 列表

    entitled_product_idsstring[]

    授权商品 ID 列表

    entitled_variant_idsstring[]

    授权规格 ID 列表

    entitled_filter_idsstring[]

    授权过滤 ID 列表

    entitled_filter_liststring[]

    授权过滤列表

    variant_product_idsstring[]

    规格所属商品 ID 列表

    entitled_collection_idsstring[]

    授权集合 ID 列表

    entitled_area_list object[]

    授权地区列表

  • Array [
  • country_codestring

    国家代码(如 CN)

    province_codesstring[]

    省份代码列表

  • ]
  • prerequisite_subtotal_range object[]

    小计前提条件范围

  • Array [
  • greater_than_or_equal_tostring

    大于或等于的值

    valuestring

    value_percentagestring

    百分比值

    value_event_typestring

    值事件类型

    value_conditionstring

    值条件

    target_typestring

    目标类型

    target_datastring[]

    目标数据

  • ]
  • prerequisite_quantity_range object[]

    数量前提条件范围

  • Array [
  • greater_than_or_equal_tostring

    大于或等于的值

    valuestring

    value_percentagestring

    百分比值

    value_event_typestring

    值事件类型

    value_conditionstring

    值条件

    target_typestring

    目标类型

    target_datastring[]

    目标数据

  • ]