跳转到内容

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

请求

使用免费购物车中的所有商品创建一个订单。创建的订单将具有done的订单状态。

安全
AuthForCart
路径
project_idinteger必需

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

示例: 44056
正文application/json
currencystring

订单价格货币。每笔订单的三个字母的货币代码ISO 4217。请查看文档以获取有关Xsolla 支持的货币

custom_parametersobject[ 1 .. 200 ] properties

项目特定参数。

localestring

响应语言。

sandboxboolean

在沙盒模式下创建订单。该选项适用于公司用户列表中指定的那些用户。

默认值 false
settingsobject

为用户配置支付流程和支付UI的设置。

curl -i -X POST \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/free/cart \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "custom_parameters": {
      "character_id": "ingameUsername"
    },
    "sandbox": true,
    "settings": {
      "ui": {
        "desktop": {
          "header": {
            "close_button": false,
            "is_visible": true,
            "type": "normal",
            "visible_logo": true,
            "visible_name": true,
            "visible_purchase": true
          }
        },
        "theme": "63295a9a2e47fab76f7708e1"
      }
    }
  }'

响应

成功创建免费订单。

正文application/json
order_idinteger

订单ID。

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

使用指定免费购物车创建订单Client-side

请求

使用指定免费购物车中的所有商品创建一个订单。创建的订单将具有done的订单状态。

安全
AuthForCart
路径
project_idinteger必需

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

示例: 44056
cart_idstring必需

购物车ID。

示例: custom_id
正文application/json
currencystring

订单价格货币。每笔订单的三个字母的货币代码ISO 4217。请查看文档以获取有关Xsolla 支持的货币

custom_parametersobject[ 1 .. 200 ] properties

项目特定参数。

localestring

响应语言。

sandboxboolean

在沙盒模式下创建订单。该选项适用于公司用户列表中指定的那些用户。

默认值 false
settingsobject

为用户配置支付流程和支付UI的设置。

curl -i -X POST \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/free/cart/custom_id \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "custom_parameters": {
      "character_id": "ingameUsername"
    },
    "sandbox": true,
    "settings": {
      "ui": {
        "desktop": {
          "header": {
            "close_button": false,
            "is_visible": true,
            "type": "normal",
            "visible_logo": true,
            "visible_name": true,
            "visible_purchase": true
          }
        },
        "theme": "63295a9a2e47fab76f7708e1"
      }
    }
  }'

响应

成功创建免费订单。

正文application/json
order_idinteger

订单ID。

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

使用指定免费商品创建订单Client-side

请求

使用指定免费商品创建订单。创建的订单将具有done的订单状态。

安全
XsollaLoginUserJWT
路径
project_idinteger必需

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

示例: 44056
item_skustring必需

商品SKU。

示例: booster_mega_1
正文application/json
currencystring

订单价格货币。每笔订单的三个字母的货币代码ISO 4217。请查看文档以获取有关Xsolla 支持的货币

custom_parametersobject[ 1 .. 200 ] properties

项目特定参数。

localestring

响应语言。

promo_codestring

随支付兑换促销码活动代码。

quantityinteger>= 1

商品数量。

默认值 1
sandboxboolean

在沙盒模式下创建订单。该选项适用于公司用户列表中指定的那些用户。

默认值 false
settingsobject

为用户配置支付流程和支付UI的设置。

curl -i -X POST \
  https://xsolla.redocly.app/_mock/zh/api/shop-builder/v2/project/44056/free/item/booster_mega_1 \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "custom_parameters": {
      "character_id": "ingameUsername"
    },
    "promo_code": "discount_code",
    "quantity": 5,
    "sandbox": true,
    "settings": {
      "ui": {
        "desktop": {
          "header": {
            "close_button": false,
            "is_visible": true,
            "type": "normal",
            "visible_logo": true,
            "visible_name": true,
            "visible_purchase": true
          }
        },
        "theme": "63295a9a2e47fab76f7708e1"
      }
    }
  }'

响应

成功创建免费订单。

正文application/json
order_idinteger

订单ID。

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

目录

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

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

优惠券

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

操作

促销码

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

操作

特别目录优惠

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

操作

折扣

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

操作

奖励

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

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