Xsolla-logoXsolla Developers
前往发布商帐户

更新奖励促销活动Server-sideAdmin

put/v2/project/{project_id}/admin/promotion/{promotion_id}/bonus

更新促销活动。

注意

如果只想更新促销活动的一部分,也应在请求中传输所有必需数据。

促销活动对进行购买的用户给予免费的奖励商品。 促销活动可以应用于项目中的任何购买或包含特定商品的购买。

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

项目ID。您可以在您的发布商帐户项目名称旁边找到。

Example: 44056
promotion_id
required
integer

促销活动ID。项目内的唯一促销活动标识符。

Example: 111425
Request Body schema: application/json
required
Array of objects or null

要应用促销必须在购买项中包含的一组商品。如果此参数为null,则促销将应用于项目内的任何购买。

Array
sku
string
Default: "elven_sword"

商品SKU。

required
Array of objects or null
Array
quantity
number
Default: 1

商品数量。

sku
string
Default: "elven_shield"

商品SKU。

required
object

促销活动名称。应包含键/值对,其中键是"^[a-z]{2}-[A-Z]{2}$"格式的区域设置,值是字符串。

property name*
additional property
string
Array of type = string (objects) or Array of type = date (objects) or Array of type = number (objects)
One of:
[ 1 .. 100 ] items
Array ([ 1 .. 100 ] items)
attribute
required
string [ 1 .. 255 ] characters ^[-_.\d\w]+$

用户属性代码。

operator
required
string

按条件执行的操作类型。用于string属性类型。

Enum: Description
eq

等于

ne

不等于

value
required
string <= 255 characters

与用户属性值进行比较的条件值。类型取决于属性类型。

type
required
string

用户属性类型。

Value: "string"
can_be_missing
boolean

表示即使用户属性中缺少属性仍满足条件。传递true可向不具有此属性的用户显示该项目。具有该属性但值与条件中指定的值不匹配的用户将看不到该商品。传递false则具有该属性但值与条件中指定的值不匹配或缺少该属性的用户将看不到该商品。

date_end
string or null <date-time>
Default: "2020-04-15T18:16:00+05:00"

促销活动结束日期。可以是null。如果date_endnull,则促销活动无时间限制。

date_start
string or null <date-time>
Default: "2020-04-15T18:16:00+05:00"

促销活动开始日期。

excluded_promotions
Array of integers

应用此促销活动时要排除的促销活动ID列表。
Example:[12, 789]

id
integer

促销活动ID。项目内的唯一促销活动标识符。

object

促销活动限制。

per_user
integer or null

针对单独用户的促销活动限制。

object or null

限制次数刷新周期。

interval_type = daily (object) or interval_type = weekly (object) or interval_type = monthly (object)
One of:

每天类型的用户限制次数刷新。

interval_type
required
string

循环刷新周期。

Value: "daily"
time
required
string((0[0-9]|1[0-9]|2[0-3]):00:00)(\+|-)(0[0-9]|1...

所需时区的限制次数刷新时间(四舍五入到小时)。

Array of objects or null

Array of objects with conditions that set the price range for applying the promotion.
The promotion applies only to items whose price meets all the conditions in the array. If you pass this array, set the value of the condition object to null.

Array
operator
required
string

用于设置应用促销活动的价格范围的比较运算符。

Enum: Description
eq

等于

ge

大于或等于

gt

大于

le

小于或等于

lt

小于

ne

不等于

value
required
string^\d+(\.\d{1,4})?$

用于决定应用促销活动的价格范围的值。

Responses
204

促销活动已成功更新。

401

基本认证未通过或错误。确保您使用了基本认证或正确的凭据。

422

无效的请求。

Request samples
application/json
{
  • "attribute_conditions": [
    ],
  • "bonus": [
    ],
  • "condition": [
    ],
  • "date_end": "2020-04-25T18:16:00+05:00",
  • "date_start": "2020-04-15T18:16:00+05:00",
  • "name": {
    }
}
Response samples
application/json
{
  • "errorCode": 1020,
  • "errorMessage": "[0401-1020]: Error in Authentication method occurred",
  • "statusCode": 401
}