跳转到内容

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属性

操作
操作
操作

获取捆绑包列表Client-side

请求

获取用于构建目录的捆绑包列表。

注意:

所有项目对于可以在响应中获得的商品数量均都限制。默认值和最大值是每个响应50项。

注:

使用商品目录API调用无需授权,但若需获取个性化目录,必须在Authorization头中传入用户JWT。
安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
查询
limitinteger>= 1

页面上元素数量的限制。

示例: limit=50
offsetinteger>= 0

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

示例: offset=0
localestring

响应语言。按照ISO 639-1规定使用两个小写字母的语言代码。

默认值 "en"
additional_fields[]Array of strings

附加字段列表。如果在请求中发送这些字段,则它们将包含在响应中。

枚举"media_list""order""long_description""custom_attributes""item_order_in_group"
countrystring

ISO 3166-1 alpha-2标准下的两个大写字母的国家/地区代码。 请查看文档详细了解艾克索拉支持的国家/地区国家/地区的判断流程

示例: country=US
promo_codestring[ 1 .. 128 ] characters

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

示例: promo_code=WINTER2021
show_inactive_time_limited_itemsinteger

显示用户不可用的时效性商品。此类商品的有效期尚未开始或已过期。

默认值 0
示例: show_inactive_time_limited_items=1
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/items/bundle?limit=50&offset=0&locale=en&additional_fields%5B%5D=media_list&country=US&promo_code=WINTER2021&show_inactive_time_limited_items=1' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

捆绑包列表已成功接收。

正文application/json
has_moreboolean(Pagination_has-more)

用作指示还有更多页面。

示例: true
itemsArray of objects(Bundles_client_bundle)
响应
application/json
{ "has_more": true, "items": [ {} ] }

获取指定组的捆绑包列表Client-side

请求

获取组内的捆绑包列表以构建目录。

注意:

所有项目对于可以在响应中获得的商品数量均都限制。默认值和最大值是每个响应50项。

注:


使用商品目录API调用无需授权,但若需获取个性化目录,必须在Authorization头中传入用户JWT。
安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
external_idstring必需

组外部ID。

默认值 "all"
查询
limitinteger>= 1

页面上元素数量的限制。

示例: limit=50
offsetinteger>= 0

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

示例: offset=0
localestring

响应语言。按照ISO 639-1规定使用两个小写字母的语言代码。

默认值 "en"
additional_fields[]Array of strings

附加字段列表。如果在请求中发送这些字段,则它们将包含在响应中。

枚举"media_list""order""long_description""custom_attributes""item_order_in_group"
countrystring

ISO 3166-1 alpha-2标准下的两个大写字母的国家/地区代码。 请查看文档详细了解艾克索拉支持的国家/地区国家/地区的判断流程

示例: country=US
promo_codestring[ 1 .. 128 ] characters

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

示例: promo_code=WINTER2021
show_inactive_time_limited_itemsinteger

显示用户不可用的时效性商品。此类商品的有效期尚未开始或已过期。

默认值 0
示例: show_inactive_time_limited_items=1
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/items/bundle/group/{external_id}?limit=50&offset=0&locale=en&additional_fields%5B%5D=media_list&country=US&promo_code=WINTER2021&show_inactive_time_limited_items=1' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

捆绑包列表已成功接收。

正文application/json
has_moreboolean(Pagination_has-more)

用作指示还有更多页面。

示例: true
itemsArray of objects(Bundles_client_bundle)
响应
application/json
{ "has_more": true, "items": [ {} ] }

获取指定的捆绑包Client-side

请求

获取指定的捆绑包。

注:

此端点无需授权即可访问,返回通用数据。但是授权后可以通过用户详细信息来丰富响应,获得个性化结果,例如适用的用户限制和促销活动等。
安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
skustring必需

捆绑包SKU。

示例: kg_1
查询
promo_codestring[ 1 .. 128 ] characters

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

示例: promo_code=WINTER2021
show_inactive_time_limited_itemsinteger

显示用户不可用的时效性商品。此类商品的有效期尚未开始或已过期。

默认值 0
示例: show_inactive_time_limited_items=1
additional_fields[]Array of strings

附加字段列表。如果在请求中发送这些字段,则它们将包含在响应中。

枚举"media_list""order""long_description""custom_attributes""item_order_in_group"
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/items/bundle/sku/kg_1?promo_code=WINTER2021&show_inactive_time_limited_items=1&additional_fields%5B%5D=media_list' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

响应

指定的捆绑包已成功接收。

正文application/json
attributesArray of objects(Bundles_client-attributes)

与商品对应的属性及其值的列表。可用于目录筛选。

默认值 []
示例: {"value":{"external_id":"genre","name":"Жанр","values":[{"external_id":"genre_e3364991f92e751689a68b96598a5a5a84010b85","value":"Casual"},{"external_id":"genre_eba07bfd0f982940773cba3744d97264dd58acd7","value":"Strategy"},{"external_id":"genre_b8d0c6d8f0524c2b2d79ebb93aa3cd0e8b5199a8","value":"Mobile"}]}}
bundle_typestring(Bundles_bundle_type)

捆绑包类型。使用standard创建包含商品的捆绑包,并指定捆绑包中所含商品的SKU。 使用partner_side_content创建一个空的捆绑包,并使用Webhook在己侧添加商品。此类型仅用于合作伙伴侧的目录个性化

默认值 "standard"
枚举"standard""partner_side_content"
示例: "standard"
can_be_boughtboolean(Can_be_bought)

如为true,则用户可以购买商品。

示例: true
contentArray of objects(Bundles_client_content)

捆绑包套餐内容。

示例: [{"attributes":[],"description":"Big Rocket - short description.","groups":[],"image_url":"https://popmedia.blob.core.windows.net/popyourself/male/outfit/male_armor_white_a-01.png","is_free":false,"name":"Big Rocket","price":{"amount":"10.99","amount_without_discount":"10.99","currency":"USD"},"quantity":100,"sku":"com.xsolla.big_rocket_1","type":"virtual_currency"}]
custom_attributesobject(json)(item-custom-attributes-response)

包含商品属性和值的JSON对象。

descriptionstring or null(Bundles_client_description)

商品描述。

示例: "Big Rocket - description."
groupsArray of objects(items_client_groups_response)

商品所属分组。

默认值 []
示例: [{"external_id":"exclusive","name":"Exclusive"}]
image_urlstring or null(Bundles_image_url)

图像URL。

示例: "https://image.example.com"
is_freeboolean(value-is_free)

如果为true,则该商品为免费。

默认值 false
示例: false
item_idinteger(Bundles_item_id)[ 1 .. 255 ] characters

内部唯一物品ID。

示例: 1
limitsobject or null(Catalog_item_limits_with_hourly)

商品限制。

long_description(two-letter (object or null)) or (five-letter (object or null))(long-description-localization-object)

包含商品详细本地化描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

Any of:

包含商品详细本地化描述的对象。值接受以下两种格式之一:两个小写字母的语言代码(例如,en)或五个字符的区域设置代码(例如,en-US)。虽然两种格式都可作为输入接受,但响应会返回两个小写字母的语言代码。当为同一种语言提供了两种输入时(例如:enen-US),将存储最后提供的值。您可以在文档中找到支持语言的完整列表。

media_listArray of objects(Bundles_media_list)

捆绑包的附加资源。

示例: [{"type":"image","url":"https://cdn3.xsolla.com/img/misc/images/71ab1e12126f2103e1868076f0acb21a.jpg"}]
namestring(Bundles_client_name)

商品名称。

示例: "Big Rocket"
orderinteger(Bundles_order)

列表中的捆绑包顺序优先级。

默认值 1
示例: 1
periodsArray of objects or null(item-periods)

商品促销时间段。

priceobject or null(Bundles_price)

商品价格。

promotionsArray of objects(Catalog_item_promotions)

应用于购物车中指定商品的促销活动。仅在以下情况下返回该数组:

  • 为某商品配置了折扣促销活动。

  • 应用了对所选商品提供折扣设置的促销码。

如果未应用任何商品级促销活动,则返回空数组。

skustring(Bundles_sku)[ 1 .. 255 ] characters^[a-zA-Z0-9_\-–.]*$

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

示例: "bundle_1"
total_content_priceobject or null(Bundles_total_content_price)

捆绑包内容价格总和。

typestring(Bundles_type)

商品类型。

示例: "bundle"
virtual_pricesArray of objects(Bundles_virtual_prices)

虚拟价格。

vp_rewardsArray of objects(client-item-value-point-reward)

奖励积分商品奖励。

响应
application/json
{ "attributes": [], "bundle_type": "standard", "can_be_bought": true, "content": [ {} ], "custom_attributes": { "attr": "value", "purchased": 0 }, "description": "pricePoint_44056_1.", "groups": [], "image_url": null, "is_free": false, "item_id": 610316, "limits": { "per_user": {} }, "long_description": null, "media_list": [], "name": "kg_10.00_bundle", "order": 999, "periods": [ {} ], "price": { "amount": "9.99", "amount_without_discount": "9.99", "currency": "USD" }, "promotions": [], "sku": "com.xsolla.kg_1", "total_content_price": { "amount": "10.99", "amount_without_discount": "10.99", "currency": "USD" }, "type": "bundle", "virtual_prices": [], "vp_rewards": [ {}, {} ] }
操作
操作
操作
操作
操作
操作
操作
操作
操作

目录

本API允许获取任意类型的可售商品或指定商品。

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

优惠券

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

操作

促销码

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

操作

特别目录优惠

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

操作

折扣

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

操作

奖励

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

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