跳转到内容

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让您可以管理促销码。

操作

特别目录优惠

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

操作

折扣

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

操作

奖励

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

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

设置商品的奖励积分Server-sideAdmin

请求

按SKU将奖励积分分配给一件或多件商品。用户购买这些商品后将获得奖励积分。

请注意,此PUT请求将覆盖项目中商品所有先前设置的奖励积分。

为了避免无意中删除奖励积分,请在每个PUT请求中包含所有商品及其各自的奖励积分。

如果只想更新特定商品的奖励积分,同时保留其他商品的奖励积分,则应使用GET请求检索当前的奖励积分集,修改所需商品的奖励积分,然后返回包含特定商品更新后奖励积分的奖励积分集。

安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
value_point_skustring必需

奖励积分SKU。

示例: value_point_3
正文application/jsonArray [
amountinteger必需

奖励积分的数量。

skustring(sku)[ 1 .. 255 ] characters^[a-zA-Z0-9_\-–.]*$必需

唯一商品ID。 SKU只能包含大小写英文字母和数字字符、句点、破折号和下划线。

示例: "booster_mega_1"
]
curl -i -X PUT \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/admin/items/value_point_3/value_points/rewards \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "amount": 100,
      "sku": "com.xsolla.booster_1"
    },
    {
      "amount": 200,
      "sku": "com.xsolla.booster_mega"
    }
  ]'

响应

已成功更新商品的奖励积分。

正文
响应
无内容

获取奖励链列表Server-sideAdmin

请求

获取奖励链列表。

注意:

所有项目对于可以在响应中获得的商品数量均都限制。默认值和最大值是每个响应10项。要逐页获取更多数据,请使用limitoffset字段。
安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
查询
limitinteger>= 1

页面上元素数量的限制。

示例: limit=50
offsetinteger>= 0

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

示例: offset=0
enabledinteger

通过is_enabled标志筛选元素。

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

响应

已成功接收奖励链列表。

正文application/json
has_moreboolean(Pagination_has-more)

用作指示还有更多页面。

示例: true
itemsArray of admin-get-reward-chain-item-basic-model (object) or admin-get-reward-chain-item-clan-basic-model (object)
响应
application/json
{ "has_more": true, "items": [ {}, {} ] }

创建奖励链Server-sideAdmin

请求

创建奖励链。

安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
正文application/json
One of:

一个奖励链。

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

用户属性验证条件。 根据用户属性是否满足所有指定条件来确定优惠链可用性。

description(two-letter (object or null)) or (five-letter (object or null))(description-localization-object)

包含本地化商品描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

One of:

包含本地化商品描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

image_urlstring or null(image_url)

图像URL。

示例: "https://image.example.com"
is_always_visibleboolean(chain_is_always_visible)

优惠链是否对所有用户可见:

  • 如为true,则无论用户的认证状态或属性如何,优惠链始终显示。
  • 如为false,则仅在未找到个性化优惠链时才显示该优惠链。例如,当用户未认证或其属性与任何个性化优惠链都不匹配时。

仅适用于存在个性化奖励链的前提,并在未传递attribute_conditions数组时使用。

默认值 true
示例: true
is_enabledboolean(is_enabled)必需
示例: true
is_reset_after_endboolean(is_reset_after_end)

是否在结束日期后重置奖励链(所有用户的奖励积分和进度):

  • 如为true,奖励链将在结束日期后重置。
  • 如为false,奖励链在结束日期后不重置。

注意

以下情况不能设置为true
  • recurrent_schedule中已设置重置周期。
  • periods.date_until中传入了null值。
默认值 false
示例: false
long_description(two-letter (object or null)) or (five-letter (object or null))(long-description-localization-object)

包含商品详细本地化描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

Any of:

包含商品详细本地化描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

name(two-letter (object or null)) or (five-letter (object or null))(name-localization-object)必需

包含商品本地化名称的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的语言代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

One of:

包含商品本地化名称的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的语言代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

name.​arstring or null

阿拉伯语

name.​bgstring or null

保加利亚语

name.​cnstring or null

中文(简体)

name.​csstring or null

捷克语

name.​destring or null

德语

name.​enstring or null

英语

name.​esstring or null

西班牙语(西班牙)

name.​frstring or null

法语

name.​hestring or null

希伯来语

name.​idstring or null

印度尼西亚语

name.​itstring or null

意大利语

name.​jastring or null

日语

name.​kmstring or null

高棉语

name.​kostring or null

韩语

name.​lostring or null

老挝语

name.​mystring or null

缅甸语

name.​nestring or null

尼泊尔语

name.​phstring or null

菲律宾语

name.​plstring or null

波兰语

name.​ptstring or null

葡萄牙语

name.​rostring or null

罗马尼亚语

name.​rustring or null

俄语

name.​thstring or null

泰语

name.​trstring or null

土耳其语

name.​twstring or null

中文(繁体)

name.​vistring or null

越南语

orderinteger(order)

定义排列顺序。

示例: 1
periodsArray of objects(periods)必需

奖励链有效期。若指定了多个时间段,则date_fromdate_until均为必需。

periods[].​date_fromstring(date-time)必需

指定奖励链的开始日期。

示例: "2020-08-11T10:00:00+03:00"
periods[].​date_untilstring or null(date-time)

指定奖励链的结束日期。仅在指定单个有效期时可为null

示例: "2020-08-11T20:00:00+03:00"
recurrent_schedule(interval_type = weekly (object or null)) or (interval_type = monthly (object or null)) or (interval_type = hourly (object or null))(recurrent_schedule_create_update)

奖励链的重置周期。

One of:

奖励链的重置周期。

stepsArray of objects(create_reward_step)必需
steps[].​image_urlstring or null(image_url)

图像URL。

示例: "https://image.example.com"
steps[].​name(two-letter (object or null)) or (five-letter (object or null))(name-localization-object)必需

包含商品本地化名称的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的语言代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

One of:

包含商品本地化名称的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的语言代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

steps[].​name.​arstring or null

阿拉伯语

steps[].​name.​bgstring or null

保加利亚语

steps[].​name.​cnstring or null

中文(简体)

steps[].​name.​csstring or null

捷克语

steps[].​name.​destring or null

德语

steps[].​name.​enstring or null

英语

steps[].​name.​esstring or null

西班牙语(西班牙)

steps[].​name.​frstring or null

法语

steps[].​name.​hestring or null

希伯来语

steps[].​name.​idstring or null

印度尼西亚语

steps[].​name.​itstring or null

意大利语

steps[].​name.​jastring or null

日语

steps[].​name.​kmstring or null

高棉语

steps[].​name.​kostring or null

韩语

steps[].​name.​lostring or null

老挝语

steps[].​name.​mystring or null

缅甸语

steps[].​name.​nestring or null

尼泊尔语

steps[].​name.​phstring or null

菲律宾语

steps[].​name.​plstring or null

波兰语

steps[].​name.​ptstring or null

葡萄牙语

steps[].​name.​rostring or null

罗马尼亚语

steps[].​name.​rustring or null

俄语

steps[].​name.​thstring or null

泰语

steps[].​name.​trstring or null

土耳其语

steps[].​name.​twstring or null

中文(繁体)

steps[].​name.​vistring or null

越南语

steps[].​priceobject(reward_step_price)必需
steps[].​price.​amountinteger(step_price_amount)必需

以奖励积分表示的步骤价格。

示例: 100
steps[].​rewardArray of objects必需
steps[].​reward[].​attribute_conditionsArray of type = string (object) or type = number (object) or type = date (object)(reward-chain-step-reward_user-attribute_conditions_model-post)[ 1 .. 100 ] items

用户属性验证条件。 根据用户属性是否满足所有指定条件来确定奖励链步骤的奖励可用性。

steps[].​reward[].​quantityinteger(reward_item_quantity)必需

商品数量。

示例: 2
steps[].​reward[].​skustring(sku)[ 1 .. 255 ] characters^[a-zA-Z0-9_\-–.]*$必需

唯一商品ID。 SKU只能包含大小写英文字母和数字字符、句点、破折号和下划线。

示例: "booster_mega_1"
value_pointobject必需
value_point.​skustring(sku)[ 1 .. 255 ] characters^[a-zA-Z0-9_\-–.]*$必需

唯一商品ID。 SKU只能包含大小写英文字母和数字字符、句点、破折号和下划线。

示例: "booster_mega_1"
curl -i -X POST \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v3/project/44056/admin/reward_chain \
  -H 'Content-Type: application/json' \
  -d '{
    "clan_type": "guild",
    "description": {
      "en": "Clan reward chain description."
    },
    "image_url": "https://cdn.xsolla.net/img/misc/images/5c3b8b45c5be5fe7803e59fbc8041be4.png",
    "is_enabled": true,
    "long_description": {
      "en": "Clan reward chain long description."
    },
    "name": {
      "en": "Clan reward chain"
    },
    "order": 1,
    "periods": [
      {
        "date_from": "2026-01-01T01:00:00+05:00",
        "date_until": "2026-01-31T23:59:59+05:00"
      },
      {
        "date_from": "2026-02-01T01:00:00+05:00",
        "date_until": "2026-02-28T23:59:59+05:00"
      }
    ],
    "popup_header": {
      "en": "How to unlock rewards"
    },
    "popup_image_url": "https://cdn.xsolla.net/img/misc/images/5c3b8b45c5be5fe7803e59fbc8041be4.png",
    "popup_instruction": {
      "en": "You must be a clan member to get clan rewards. You join a clan when a clan member invites you to the clan, and you accept the invite. You can also create your own clan."
    },
    "recurrent_schedule": {
      "day_of_week": 1,
      "interval_type": "weekly",
      "time": "01:00:00+08:00"
    },
    "steps": [
      {
        "image_url": "https://cdn.xsolla.net/img/misc/images/5c3b8b45c5be5fe7803e59fbc8041be4.png",
        "name": {
          "en": "First step of the reward chain"
        },
        "price": {
          "amount": 10
        },
        "reward": [
          {
            "quantity": 5,
            "sku": "com.xsolla.item_1"
          },
          {
            "quantity": 1,
            "sku": "com.xsolla.item_2"
          }
        ]
      },
      {
        "image_url": "https://cdn.xsolla.net/img/misc/images/5c3b8b45c5be5fe7803e59fbc8041be4.png",
        "name": {
          "en": "Second step of the reward chain"
        },
        "price": {
          "amount": 15
        },
        "reward": [
          {
            "quantity": 5,
            "sku": "com.xsolla.item_3"
          },
          {
            "quantity": 1,
            "sku": "com.xsolla.item_4"
          }
        ]
      }
    ],
    "value_point": {
      "sku": "com.xsolla.clan_value_point_1"
    }
  }'

响应

已成功创建奖励链。

正文application/json
reward_chain_idinteger
示例: 10
响应
application/json
{ "reward_chain_id": 10 }
操作
操作
操作
操作
操作
操作
操作
操作
操作