跳转到内容

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让您可以管理优惠券。

操作

创建优惠券促销活动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)
external_idstring(Promotions_coupon-external_id)必需

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

默认值 "coupon_external_id"
示例: "coupon_external_id"
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附加属性
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/coupon \
  -H 'Content-Type: application/json' \
  -d '{
    "attribute_conditions": [
      {
        "attribute": "account_status",
        "can_be_missing": false,
        "operator": "eq",
        "type": "string",
        "value": "golden"
      }
    ],
    "bonus": [
      {
        "quantity": 1,
        "sku": "com.xsolla.elven_sword_2"
      }
    ],
    "external_id": "coupon_external_id",
    "name": {
      "de-DE": "Neujahrsbonus",
      "en-US": "New Year Bonus"
    },
    "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/coupon/coupon_44056_1

响应

优惠券促销活动成功删除。

响应
无内容

获取优惠券促销活动Server-sideAdmin

请求

获取指定的优惠券促销活动。

安全
basicAuth
路径
project_idinteger必需

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

示例: 44056
external_idinteger必需

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

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

响应

优惠券已成功收到。

正文application/json
attribute_conditionsArray of type = string (object) or type = number (object) or type = date (object)(promotion_user-attribute_conditions_model-get)[ 1 .. 100 ] items

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

bonusArray of objects or null(Promotions_coupon_bonus)
external_idstring(Promotions_coupon-external_id)

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

默认值 "coupon_external_id"
示例: "coupon_external_id"
is_enabledboolean(Promotions_coupon-is_enabled)
默认值 true
nameobject(Promotions_coupon_name)

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

默认值 {"de-DE":"Gutscheintitel","en-US":"Coupon title"}
示例: {"de-DE":"Gutscheintitel","en-US":"Coupon title"}
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
total_limit_stateobject or null(Promotions_coupon_total_limit_state)

每个唯一优惠券码的限制。

响应
application/json
{ "bonus": [ {} ], "external_id": "summer20221", "is_enabled": true, "name": { "en-US": "Coupon name", "ru-RU": "Название купона" }, "promotion_periods": [ {}, {} ], "redeem_code_limit": null, "redeem_total_limit": 100, "redeem_user_limit": null, "total_limit_state": { "available": 50, "reserved": 10, "used": 40 } }

促销码

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

操作

特别目录优惠

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

操作

折扣

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

操作

奖励

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

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