# 更新奖励促销活动 更新促销活动。 注意如果只想更新促销活动的一部分,也应在请求中传输所有必需数据。 促销活动对进行购买的用户给予免费的奖励商品。 促销活动可以应用于项目中的任何购买或包含特定商品的购买。 Endpoint: PUT /v3/project/{project_id}/admin/promotion/{promotion_id}/bonus Version: 2.0.0 Security: basicAuth ## Path parameters: - `project_id` (integer, required) 项目ID。您可以在您的发布商帐户项目名称旁边找到。 Example: 44056 - `promotion_id` (integer, required) 促销活动ID。项目内的唯一促销活动标识符。 Example: 111425 ## Request fields (application/json): - `attribute_conditions` (array) 用户属性验证条件。 根据用户属性是否满足所有指定条件来确定促销活动可用性。 - `bonus` (array,null, required) - `bonus.quantity` (number) 商品数量。 - `bonus.sku` (string) 商品SKU。 - `condition` (array,null, required) 要应用促销必须在购买项中包含的一组商品。如果此参数为null,则促销将应用于项目内的任何购买。 - `excluded_promotions` (array) 应用此促销活动时要排除的促销活动ID列表。Example:[12, 789] Example: [12,789] - `id` (integer) 促销活动ID。项目内的唯一促销活动标识符。 - `is_enabled` (boolean) 是否启用了促销活动。 Example: true - `limits` (object) 促销活动限制。 - `limits.per_user` (integer,null) 针对单独用户的促销活动限制。 - `limits.recurrent_schedule` (object,null) 限制次数刷新周期。 - `limits.recurrent_schedule.per_user` (object) 用户限制刷新周期。 - `limits.recurrent_schedule.per_user.day_of_month` (integer,null) 在一个月中的哪一天刷新限制次数。如果由于较短的月没有选择具体哪一天,刷新将在该月的最后一天发生。仅针对monthly限制刷新周期类型不为null。 - `limits.recurrent_schedule.per_user.day_of_week` (integer,null) 在一周中的哪一天刷新限制次数。其中1是星期一,7是星期日。仅针对weekly限制刷新周期类型不为null。 - `limits.recurrent_schedule.per_user.displayable_reset_next_date` (string) 应重置限制次数的日期和时间 (ISO 8601)。 Example: "2023-02-28T11:00:00+08:00" - `limits.recurrent_schedule.per_user.displayable_reset_start_date` (string) 第一次限制次数刷新的日期和时间 (ISO 8601)。 Example: "2023-02-28T11:00:00+08:00" - `limits.recurrent_schedule.per_user.interval_type` (string) 循环刷新周期类型。 Enum: "daily", "weekly", "monthly" - `limits.recurrent_schedule.per_user.reset_next_date` (integer) 限制次数刷新的日期和时间(Unix时间戳)。 Example: 1677553200 - `limits.recurrent_schedule.per_user.time` (string) 所需时区的限制次数刷新时间(四舍五入到小时)。 Example: "11:00:00+03:00" - `name` (object, required) 促销活动名称。应包含键/值对,其中键是"^[a-z]{2}-[A-Z]{2}$"格式的区域设置,值是字符串。 Example: {"de-DE":"Sommersaison Bonus","en-US":"Summer season bonus"} - `price_conditions` (array,null) 包含条件的对象数组,用于设置应用促销活动的价格范围。 促销活动仅应用于价格符合数组中所有条件的商品。如果传递此数组,请将[condition](/zh/api/shop-builder/operation/create-bonus-promotion/#!path=condition&t=request)对象的值设置为null。 - `price_conditions.operator` (string, required) 用于设置应用促销活动的价格范围的比较运算符。 Enum: "ge", "gt", "le", "lt", "eq", "ne" - `price_conditions.value` (string, required) 用于决定应用促销活动的价格范围的值。 - `promotion_periods` (array) 促销活动有效期。若指定了多个时间段,则date_from和date_until均为必需。 - `promotion_periods.date_from` (string, required) 指定促销活动的开始日期。 Example: "2020-08-11T10:00:00+03:00" - `promotion_periods.date_until` (string,null) 促销活动的结束日期。设置为null时,促销活动永久有效。仅在指定单个有效期时可设置为null。 Example: "2020-08-11T20:00:00+03:00" ## Response 401 fields (application/json): - `errorCode` (integer) Example: 1020 - `errorMessage` (string) Example: "[0401-1020]: Error in Authentication method occurred" - `statusCode` (integer) Example: 401 ## Response 422 fields (application/json): - `errorCode` (integer) Example: 1102 - `errorMessage` (string) Example: "[0401-1102]: Unprocessable Entity. The property `bonus` is required" - `statusCode` (integer) Example: 422 - `transactionId` (string) Example: "x-x-x-x-transactionId-mock-x-x-x" ## Response 204 fields