跳转到内容

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

操作

获取优惠券奖励Client-side

请求

通过券码获取优惠券奖励。 可用于允许用户从众多商品中选择一个作为奖励。 通常情况下,如果优惠券包含游戏作为奖励(type=unit),则为选择一个DRM。

安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
coupon_codestring[ 1 .. 128 ] characters必需

区分大小写的唯一券码。包含字母和数字。

示例: WINTER2021
curl -i -X GET \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/coupon/code/WINTER2021/rewards \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

已成功接收优惠券奖励列表。

正文application/json
bonusArray of objects(Promotions_200-coupon-bonus-reward)
discountobject or null(Promotions_200-coupon-discount-reward)

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

is_selectableboolean

如果为true,则用户应在兑换优惠券之前选择奖励。

响应
application/json
{ "bonus": [ {}, {} ], "discount": { "percent": "10.00" }, "is_selectable": true }

请求

兑换优惠券码。用户在兑换优惠券后获得奖励。

安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
正文application/json
coupon_codestring[ 1 .. 128 ] characters

唯一优惠券码。包含字母和数字。

默认值 "WINTER2021"
示例: "WINTER2021"
selected_unit_itemsobject(Promotions_selected_unit_items)

用户选择的奖励。 对象键是单位的SKU,值是单位中一个商品的SKU。

示例: {"game_1":"game_1_steam","game_2":"game_2_playstation"}
curl -i -X POST \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/coupon/redeem \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "coupon_code": "WINTER2021",
    "selected_unit_items": {
      "game_1": "game_1_steam",
      "game_2": "game_2_playstation"
    }
  }'

响应

优惠券已成功兑换。

正文application/json
itemsArray of objects
示例: [{"attributes":[],"description":"Take it, take it all! All of Xsolla's riches in one Mega Booster.","groups":[{"external_id":"powerups","name":"Power Ups"}],"image_url":"https://cdn.xsolla.net/img/misc/images/e9f2f4a634bc96ea03b5d5ceadd7c55f.png","is_free":false,"name":"Xsolla Booster Mega","price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"quantity":1,"sku":"com.xsolla.booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[]}]
响应
application/json
{ "items": [ {} ] }

获取优惠券促销活动列表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/coupon?limit=50&offset=0'

响应

优惠券列表已成功收到。

正文application/json
active_promotions_countinteger(active_promotions_count)

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

inactive_promotions_countinteger(inactive_promotions_count)

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

itemsArray of objects(admin-promotions_200-get-coupon-promotion-model)
total_promotions_countinteger(total_promotions_count)

促销活动总数。

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

促销码

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

操作

特别目录优惠

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

操作

折扣

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

操作

奖励

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

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