跳转到内容

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让您可以管理奖励促销活动。

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

根据ID获取当前用户的优惠链Client-side

请求

根据优惠链ID获取当前用户的优惠链。

安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
offer_chain_idinteger必需

优惠链ID。

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

响应

成功获取用户的优惠链。

正文application/json
date_endstring or null(date-time)(offer_chain_date_end)

优惠链结束日期。可为null,若date_endnull则无时间限制。

示例: "2020-04-15T18:16:00+05:00"
date_startstring(date-time)(offer_chain_date_start)

优惠链开始日期。

示例: "2020-04-15T18:16:00+05:00"
descriptionstring or null

优惠链描述。

示例: "Major weekly quest"
idinteger

优惠链ID。

示例: 9
namestring

优惠链名称。

示例: "Weekly quest"
next_step_numberinteger or null

下一步优惠链步骤编号,若优惠链已完成则为null

示例: 1
orderinteger(order)

定义排列顺序。

示例: 1
recurrent_scheduleobject or null(offer_chain_recurrent_schedule_client_side)

优惠链的重置周期。

stepsArray of objects(client-offer-chain-step-model)
响应
application/json
{ "date_end": "2025-04-25T18:16:00+05:00", "date_start": "2010-04-15T18:16:00+05:00", "description": null, "id": 4, "name": "Offer chain with bundles", "next_step_number": 1, "order": 1, "recurrent_schedule": null, "steps": [ {}, {} ] }

领取免费优惠链步骤奖励Client-side

请求

完成当前用户的优惠链步骤进程,并发放相关奖励。

注意

仅对优惠链中的免费步骤使用此调用。 对于需要以真实货币支付的步骤,请改用为付费优惠链步骤创建订单调用。
安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
offer_chain_idinteger必需

优惠链ID。

示例: 101
step_numberinteger必需

优惠链步骤编号。

示例: 1
curl -i -X POST \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/user/offer_chain/101/step/number/1/claim \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

成功领取了免费步骤且奖励发放成功。

正文application/json
order_idinteger

订单ID。

响应
application/json
{ "order_id": 641 }

为付费优惠链步骤创建订单Client-side

请求

为指定的付费优惠链步骤关联的商品创建订单。所创建订单的状态为new

若要在新窗口中打开支付UI,请使用以下链接:https://secure.xsolla.com/paystation4/?token={token},其中{token}为收到的令牌。

对于测试目的,请使用此URL:https://sandbox-secure.xsolla.com/paystation4/?token={token}

注意

此方法必须在客户端侧使用。用户的IP地址用于确定所在国家/地区,这会影响适用货币和可用的支付方式。从服务器侧使用此方法可能会导致货币检测错误,并影响支付中心里的支付方式。

注意

此调用仅适用于付费优惠链步骤。 对于免费步骤,请改用领取免费优惠链步骤奖励调用。
安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
offer_chain_idinteger必需

优惠链ID。

示例: 101
step_numberinteger必需

优惠链步骤编号。

示例: 1
curl -i -X POST \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/user/offer_chain/101/step/number/1/order \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

订单已成功创建。

正文application/json
order_idinteger

订单ID。

tokenstring

支付令牌。

响应
application/json
{ "order_id": 641, "token": "f4puMEFFDZcx9nv5HoNHIkPe9qghvBQo" }
操作
操作
操作
操作
操作