跳转到内容

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/deprecated/inventory/
https://store.xsolla.com/api/
操作

请求

客户端端点。从当前用户物品库中消耗一个商品。

安全
XsollaLoginUserJWT
路径
project_idinteger必需

项目ID。

默认值 44056
查询
platformstring

用户玩游戏的发布平台。

默认值 "xsolla"
枚举"playstation_network""xbox_live""xsolla""pc_standalone""nintendo_shop""google_play""app_store_ios""android_standalone""ios_standalone""android_other"
正文application/json
quantitynumber必需

商品数量。

默认值 1
示例: 1
skustring必需

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

默认值 "booster_mega_1"
示例: "booster_mega_1"
curl -i -X POST \
  'https://xsolla.redocly.app/_mock/zh/api/deprecated/inventory/v2/project/{project_id}/user/inventory/item/consume?platform=playstation_network' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "quantity": 1,
    "sku": "booster_mega_1"
  }'

响应

用户物品库中的商品已被消耗。

响应
无内容

获取当前用户物品库Client-side

请求

客户端端点。检索当前用户物品库。

注意:

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

项目编号。您可以在您的发布商帐户项目名称旁边。

示例: 44056
查询
limitinteger>= 1

页面上元素数量的限制。

示例: limit=50
offsetinteger>= 0

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

示例: offset=0
platformstring

用户玩游戏的发布平台。

默认值 "xsolla"
枚举"playstation_network""xbox_live""xsolla""pc_standalone""nintendo_shop""google_play""app_store_ios""android_standalone""ios_standalone""android_other"
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/deprecated/inventory/v2/project/44056/user/inventory/items?limit=50&offset=0&platform=playstation_network' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

已成功检索用户物品库。

正文application/json
itemsArray of objects
示例: [{"attributes":[],"description":"Big Rocket - short description","groups":[],"image_url":"https://picture.bigrocket.png","instance_id":null,"name":"Rocket","quantity":null,"remaining_uses":1,"sku":"com.xsolla.instanciated_item_1","type":"virtual_good","virtual_item_type":"non_consumable"},{"attributes":[],"description":"description","groups":[],"image_url":"http://image.png","instance_id":null,"name":"SHOTGUN FOR TRUE RAIDERS","quantity":2,"remaining_uses":1,"sku":"com.xsolla.shotgun_raider_1","type":"virtual_good","virtual_item_type":"non_consumable"},{"attributes":[{"external_id":"stack_size","name":"Stack size","values":[{"external_id":"stack_size_value_99c25352ab6e34a0e0755fc2a9daa7a76021dce2","value":5}]},{"external_id":"licensed","name":"Licensed","values":[{"external_id":"licensed_value_d75d8034dd2f82cb3d2789f5ec1837a6c350b505","value":true}]}],"description":null,"groups":[],"image_url":null,"instance_id":null,"name":"HEADPHONES","quantity":5,"remaining_uses":1,"sku":"com.xsolla.headphones_for_pro_1","type":"virtual_good","virtual_item_type":"non_consumable"},{"attributes":[],"description":null,"groups":[],"image_url":null,"instance_id":null,"name":"UNIQUE DIAMONDS","quantity":100,"remaining_uses":1,"sku":"com.xsolla.platform_currency_1","type":"virtual_currency"}]
响应
application/json
{ "items": [ {}, {}, {}, {} ] }

获取当前用户的时效性商品Client-side

请求

客户端端点。检索当前用户的时效性商品。

安全
XsollaLoginUserJWT
路径
project_idinteger必需

项目ID。

默认值 44056
查询
platformstring

用户玩游戏的发布平台。

默认值 "xsolla"
枚举"playstation_network""xbox_live""xsolla""pc_standalone""nintendo_shop""google_play""app_store_ios""android_standalone""ios_standalone""android_other"
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/deprecated/inventory/v2/project/{project_id}/user/time_limited_items?platform=playstation_network' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

已成功检索用户的时效性商品。

正文application/json
itemsArray of objects
示例: [{"amount":10,"description":"Ruble","image_url":"https://picture.bigrocket.png","name":"Ruble","sku":"com.xsolla.VC_1","type":"virtual_currency","virtual_item_type":"non_renewing_subscription"},{"amount":5000,"description":"Xsollar","image_url":"http://image.png","name":"Xsollar","sku":"com.xsolla.VC_2","type":"virtual_currency","virtual_item_type":"non_renewing_subscription"}]
响应
application/json
{ "items": [ {}, {}, {} ] }

获取当前用户的虚拟余额Client-side

请求

客户端端点。检索当前用户的虚拟余额。

安全
XsollaLoginUserJWT
路径
project_idinteger必需

项目ID。

默认值 44056
查询
platformstring

用户玩游戏的发布平台。

默认值 "xsolla"
枚举"playstation_network""xbox_live""xsolla""pc_standalone""nintendo_shop""google_play""app_store_ios""android_standalone""ios_standalone""android_other"
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/deprecated/inventory/v2/project/{project_id}/user/virtual_currency_balance?platform=playstation_network' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

已成功检索用户的虚拟余额。

正文application/json
itemsArray of objects
示例: [{"description":"The PLEX or “30-day Pilot's License EXtension” is a virtual item that represents 30 days of subscription time and can be bought for cash and then sold to other players for in-game ISK.","expired_at":1746057600,"image_url":"https://picture.bigrocket.png","name":"PLEX","sku":"com.xsolla.plex_1","status":"active","type":"virtual_good","virtual_item_type":"non_renewing_subscription"},{"description":"WoW token allows players to buy game time World of Warcraft for money and sell it for game gold at auction.","expired_at":1546304461,"image_url":"https://picture.bigrocket.png","name":"WoW Token","sku":"com.xsolla.token_1","status":"expired","type":"virtual_good","virtual_item_type":"non_renewing_subscription"}]
响应
application/json
{ "items": [ {}, {} ] }
操作
操作