Xsolla-logo
  • 文档
  • 创建帐户

为商品创建折扣促销活动Server-sideAdmin

post/v2/project/{project_id}/admin/promotion/item

为商品创建折扣促销活动。

促销活动提供商品折扣(%)。 折扣将应用于指定商品的所有价格。

SecuritybasicAuth
Request
path Parameters
project_id
required
integer

项目编号。您可以在您的发布商帐户项目名称旁边。

Example: 44056
Request Body schema: application/json

包含促销活动数据的对象。

required
Array of objects
Array
sku
required
string
Default: "elven_sword"

商品SKU。

required
object
percent
required
string

百分比折扣。 商品价格将按照此百分比打折,然后四舍五入到小数点后两位。

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

Indicates that the condition is met even if attribute is missing from user attributes. Pass true to show the item to users who don't have this attribute. Users who have the attribute, but the value does not match that specified in the condition, will not see the item. False — users who have the attribute, but the value does not match that specified in the condition, or the attribute is missing, will not see the item.

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

促销活动结束日期。可以是null

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

促销活动开始日期。

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...

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

Responses
201

促销活动已成功创建。

401

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

422

无效的请求。

Request samples
application/json
{
  • "attribute_conditions": [
    ],
  • "date_end": "2020-04-25T18:16:00+05:00",
  • "date_start": "2020-04-15T18:16:00+05:00",
  • "discount": {
    },
  • "items": [
    ],
  • "name": {
    }
}
Response samples
application/json
{
  • "promotion_id": 2384756
}