跳转到内容

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

Shop Builder API provides a third-party solution for implementing the server side for your store interface. Use the endpoints to manage in-game items, in-game currencies, cart, player inventory, promotions, game library, etc.

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

个性化目录

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

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

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

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

目录

本API允许获取任意类型的可售商品或指定商品。

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

优惠券

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

操作

促销码

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

操作

获取促销码活动列表Server-sideAdmin

请求

获取项目的促销码列表。

安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
查询
limitinteger>= 1

页面上元素数量的限制。

示例: limit=50
offsetinteger>= 0

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

示例: offset=0
curl -i -X GET \
  -u <username>:<password> \
  'https://xsolla.redocly.app/_mock/zh/api/shop-builder/v3/project/44056/admin/promocode?limit=50&offset=0'

响应

成功收到促销码列表。

正文application/json
active_promotions_countinteger(active_promotions_count)

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

inactive_promotions_countinteger(inactive_promotions_count)

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

itemsArray of objects(Promotions_200-get-promocode-promotion-model)
total_promotions_countinteger(total_promotions_count)

促销活动总数。

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

创建促销码活动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

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

bonusArray of objects or null(Promotions_coupon_bonus)
discountobject or null
示例: {"percent":"10.10"}
discounted_itemsArray of objects or null(Promotions_discounted_items)

通过促销码打折的商品列表。

excluded_promotionsArray of integers(excluded_promotions)

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

示例: [12,789]
external_idstring(Promotions_coupon-external_id)必需

唯一促销活动ID。 external_id只能包含大小写英文字母和数字字符、句点、破折号和下划线。

默认值 "coupon_external_id"
示例: "coupon_external_id"
item_price_conditionsArray of objects or null(item_price_conditions_promocode)

包含条件的对象数组,用于设置对购物车中某些商品应用促销活动的价格范围。
将用户购物车中每个商品的价格与条件中指定的价格范围进行比较。将只对购物车中价格满足条件的商品应用奖励折扣
如果传递此数组,请将discounted_items数组的值设置为null

nameobject(Promotions_coupon_name)必需

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

默认值 {"de-DE":"Gutscheintitel","en-US":"Coupon title"}
示例: {"de-DE":"Gutscheintitel","en-US":"Coupon title"}
name.​property name*string附加属性
price_conditionsArray of objects or null(price_conditions_promocode)

包含条件的对象数组,用于设置对整个购物车应用促销活动的价格范围。
将用户购物车中所有商品的总价与条件中指定的价格范围进行比较。如果购物车的价格满足指定的条件,则将对购物车中的所有商品应用奖励折扣
如果传递此数组,请将discounted_items数组的值设置为null

promotion_periodsArray of objects(promotion_periods)

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

redeem_code_limitinteger or null(Promotions_redeem_code_limit)

每个代码的兑换次数。

默认值 10
示例: 10
redeem_total_limitinteger or null(Promotions_coupon-redeem_total_limit)

限制优惠券的总数。

默认值 10
示例: 10
redeem_user_limitinteger or null(Promotions_coupon-redeem_user_limit)

限制单个用户兑换的优惠券总数。

默认值 10
示例: 10
curl -i -X POST \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v3/project/44056/admin/promocode \
  -H 'Content-Type: application/json' \
  -d '{
    "attribute_conditions": [
      {
        "attribute": "account_status",
        "can_be_missing": false,
        "operator": "eq",
        "type": "string",
        "value": "golden"
      }
    ],
    "discount": {
      "percent": "10.10"
    },
    "external_id": "coupon_external_id",
    "name": {
      "de-DE": "Neujahrsrabatt",
      "en-US": "New Year Discount"
    },
    "promotion_periods": [
      {
        "date_from": "2020-04-15T18:16:00+05:00",
        "date_until": "2020-04-25T18:16:00+05:00"
      }
    ],
    "redeem_code_limit": 1,
    "redeem_total_limit": 100,
    "redeem_user_limit": 1
  }'

响应

促销码已成功创建。

正文application/json
external_idstring(Promotions_coupon-external_id)

唯一促销活动ID。 external_id只能包含大小写英文字母和数字字符、句点、破折号和下划线。

默认值 "coupon_external_id"
示例: "coupon_external_id"
响应
application/json
{ "external_id": "coupon_external_id" }

删除促销码活动Server-sideAdmin

请求

删除促销码活动。删除的促销活动将:

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

删除后,该促销活动无法恢复。 已删除促销活动的促销码可以添加到现有的促销活动。

安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
external_idinteger必需

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

示例: coupon_44056_1
curl -i -X DELETE \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v3/project/44056/admin/promocode/coupon_44056_1

响应

成功删除促销码活动。

响应
无内容

特别目录优惠

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

操作

折扣

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

操作

奖励

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

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