跳转到内容

Overview

  • Version: 2.0.0
  • Servers: https://store.xsolla.com/api
  • Contact Us by Email
  • Contact URL: https://xsolla.com/
  • Required TLS version: 1.2

LiveOps API提供用于提升玩家参与度的端点。

下载 OpenAPI 描述
语言
服务器
Mock server
https://xsolla.redocly.app/_mock/zh/api/liveops/
https://store.xsolla.com/api/
操作

优惠券

此API让您可以管理优惠券。

操作

促销码

此API让您可以管理促销码。

操作

特别目录优惠

此API让您可以管理特别目录优惠活动。

操作

折扣

此API让您可以管理折扣促销活动。

操作

获取商品促销活动列表Server-sideAdmin

请求

获取项目的商品促销列表。

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

安全
basicAuth
路径
project_idinteger必需

项目ID。

默认值 59080
查询
limitinteger

页面上元素数量的限制。

offsetinteger

元素编号,从该元素开始生成列表(从0开始数)。

curl -i -X GET \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/zh/api/liveops/v3/project/{project_id}/admin/promotion/item?limit=0&offset=0'

响应

已成功收到商品促销活动列表。

正文application/json
active_promotions_countinteger(active_promotions_count)

进行中的促销活动的数量。

inactive_promotions_countinteger(inactive_promotions_count)

已停用的促销活动的数量。

promotionsArray of objects
total_promotions_countinteger(total_promotions_count)

促销活动总数。

响应
application/json
{ "active_promotions_count": 4, "inactive_promotions_count": 0, "promotions": [ {}, {}, {}, {} ], "total_promotions_count": 4 }

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

请求

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

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

安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
正文application/json必需

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

attribute_conditionsArray of type = string (object) or type = number (object) or type = date (object)(promotion_user-attribute_conditions_model-post)[ 1 .. 100 ] items

用户属性验证条件。 根据用户属性是否满足所有指定条件来确定促销活动可用性。

discountobject必需
discount.​percentstring必需

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

示例: 10
excluded_promotionsArray of integers(excluded_promotions)

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

示例: [12,789]
is_enabledboolean(Promotions_is_enabled)

是否启用了促销活动。

示例: true
itemsArray of objects必需
items[].​skustring必需

商品SKU。

默认值 "elven_sword"
limitsobject(Promotions_promotion_limits)

促销活动限制。

nameobject必需

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

示例: {"en-US":"Promotion","ru-RU":"Акция"}
name.​property name*string附加属性
price_conditionsArray of objects or null(price_conditions_discount)

具有设置促销价格范围的条件的对象数组。
促销仅适用于价格符合数组中所有条件的商品。如果传递此数组,请设置items对象为null

promotion_periodsArray of objects(promotion_periods)

促销活动有效期。若指定了多个时间段,则date_fromdate_until均为必需。

curl -i -X POST \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/liveops/v3/project/44056/admin/promotion/item \
  -H 'Content-Type: application/json' \
  -d '{
    "attribute_conditions": [
      {
        "attribute": "race",
        "operator": "eq",
        "type": "string",
        "value": "ork"
      },
      {
        "attribute": "level",
        "can_be_missing": true,
        "operator": "eq",
        "type": "number",
        "value": "10"
      }
    ],
    "discount": {
      "percent": "24.00"
    },
    "is_enabled": true,
    "items": [],
    "name": {
      "en-US": "Ork set discount",
      "ru-RU": "Скидка на набор для орка"
    },
    "promotion_periods": [
      {
        "date_from": "2020-04-15T18:16:00+05:00",
        "date_until": "2020-04-25T18:16:00+05:00"
      }
    ]
  }'

响应

促销活动已成功创建。

正文application/json
promotion_idinteger

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

响应
application/json
{ "promotion_id": 2384756 }

删除商品促销活动Server-sideAdmin

请求

删除折扣促销活动。删除的促销活动将:

  • 从您项目中设置的促销活动列表中消失。
  • 不再适用于商品目录和购物车。用户无法通过该促销活动购买商品。

删除后,该促销活动无法恢复。

安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
promotion_idinteger必需

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

示例: 111425
curl -i -X DELETE \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/liveops/v3/project/44056/admin/promotion/111425/item

响应

成功删除促销活动。

响应
无内容

奖励

此API让您可以管理奖励促销活动。

操作

个性化目录

此API可让您针对用户属性指定规则。如果用户满足具体规则的所有条件,则会显示个性化商品。

有关个性化促销活动的信息,请参阅促销活动部分

要在购买前传递属性,您可以使用艾克索拉Login API或在使Pay Station API生成令牌时将它们传入user.attributes属性

操作
操作
操作
操作
操作
操作
操作
操作
操作
操作
操作