跳转到内容

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允许获取任意类型的可售商品或指定商品。

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

请求

确定代码是促销码还是优惠券码以及用户是否可以应用它。

安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

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

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

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

响应

有关代码的信息。

正文application/json
codestring(Promotions_coupon_code)[ 1 .. 128 ] characters^[a-zA-Z0-9]+$

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

默认值 "WINTER2021"
示例: "WINTER2021"
rewardsCoupon_rewards (object) or Promo_code_rewards_verify (object)
One of:
typestring

代码类型:promocode/coupon

响应
application/json
{ "code": "WINTER2023", "rewards": { "bonus": [], "is_selectable": true }, "type": "coupon" }

获取所有促销活动列表Server-sideAdmin

请求

获取项目的促销活动列表。

安全
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/promotion?limit=50&offset=0&enabled=0'

响应

已成功接收促销活动列表。

正文application/json
active_promotions_countinteger(active_promotions_count)

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

inactive_promotions_countinteger(inactive_promotions_count)

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

promotionsArray of objects(Promotions_200-get-promotion-model)
total_promotions_countinteger(total_promotions_count)

促销活动总数。

响应
application/json
{ "active_promotions_count": 3, "inactive_promotions_count": 2, "promotions": [ {}, {}, {}, {}, {} ], "total_promotions_count": 5 }

通过代码获取兑换型促销活动Server-sideAdmin

请求

通过促销码或优惠券码获取促销活动。

安全
basicAuth
路径
project_idinteger必需

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

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

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

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

响应

成功收到促销活动。

正文application/json
bonusArray of objects or null(Promotions_coupon_bonus)
discountobject or null

仅适用于促销码。

示例: {"discount":{"percent":"10.99"}}
discounted_itemsArray of objects or null

通过促销码打折的商品列表。仅适用于促销码。

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": "coupon_fall_hammer_2", "is_enabled": true, "name": { "en": "This is a Coupon code for Epic Fall Hammer", "ru": "Eto kod kupona на Epic Fall Hammer" }, "promotion_periods": [ {}, {} ], "redeem_code_limit": null, "redeem_total_limit": 99, "redeem_user_limit": 1 }

优惠券

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

操作

促销码

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

操作

特别目录优惠

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

操作

折扣

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

操作

奖励

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

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