跳转到内容

Digital Distribution Hub (1.0.0)

概览

Digital Distribution Hub是一个全新的艾克索拉解决方案,旨在通过推送支付(Push payments)技术和电子商务来联结数字与现金支付。

本参考指南合并介绍了用于以下两个艾克索拉产品的API端点:游戏内商店支付中心。基础URL有两个:

  • https://store.xsolla.com/api ,用于常用目录购物车订单组。
  • https://ps.xsolla.com,用于通知组。

目录组中的API端点不需要授权。

要使用购物车订单组中的操作,需通过创建用户令牌来生成一个令牌。

注:

本参考展示的是未来可能的API设计,并非已经完全运作的界面。目前只支持尝试目录通知组端点。如想向我们提供反馈,请发送邮件至techdoc@xsolla.com
下载 OpenAPI 描述
语言
服务器
Mock server
https://xsolla.redocly.app/_mock/zh/api/digital-distribution-hub/
https://store.xsolla.com/api/
操作

获取当前用户的购物车

请求

返回当前用户的购物车。

安全
AuthForClient
路径
project_idinteger必需

项目ID。

示例: 44056
查询
currencystring

显示价格的货币(默认为美元)。符合ISO 4217标准的三字母货币代码。

默认值 "USD"
localestring

响应语言。符合ISO 639-1标准的两个小写字母的语言代码。

默认值 "en"
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/zh/api/digital-distribution-hub/v2/project/44056/cart?currency=USD&locale=en' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

响应

已成功返回含商品的购物车。

正文application/json
cart_idstring

购物车ID。

示例: "cart_id"
is_freeboolean

如果为true,则购物车为免费。

itemsArray of objects(Cart_inline_response_200_items)
示例: [{"attributes":[],"description":"Take it, take it all! All of Xsollas riches in one Mega Booster.","groups":[{"external_id":"powerups","name":"Power Ups"}],"image_url":"https://cdn.xsolla.net/img/misc/images/e9f2f4a634bc96ea03b5d5ceadd7c55f.png","inventory_options":{"consumable":{"usages_count":1}},"is_free":false,"name":"Xsolla Booster Mega","price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"quantity":123,"sku":"booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[]}]
priceobject or null(Cart_inline_response_200_price)

购物车价格。

示例: "{\"amount\":\"6150.0000000000000000\",\"amount_without_discount\":\"6150.0000000000000000\",\"currency\":\"USD\"}"
响应
application/json
{ "cart_id": "cart_id", "is_free": false, "items": [ {} ], "price": { "amount": "6150.0000000000000000", "amount_without_discount": "6150.0000000000000000", "currency": "USD" } }

从当前购物车中删除所有购物车商品

请求

删除所有购物车商品。

安全
AuthForClient
路径
project_idinteger必需

项目ID。

示例: 44056
curl -i -X PUT \
  https://xsolla.redocly.app/_mock/zh/api/digital-distribution-hub/v2/project/44056/cart/clear \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'

响应

购物车已成功清空。

请求

用商品填充购物车。如果购物车中已有具有相同SKU的商品,则现有商品将被传入的值替换。

安全
AuthForClient
路径
project_idinteger必需

项目ID。

示例: 44056
正文application/json
currencystring(Cart-Payment_settings_currency)

首选支付币种。参照ISO 4217标准的三字母货币代码。

itemsArray of objects必需

商品列表。

items[].​quantitynumber必需
默认值 123
items[].​skustring必需
默认值 "booster_mega_1"
curl -i -X PUT \
  https://xsolla.redocly.app/_mock/zh/api/digital-distribution-hub/v2/project/44056/cart/fill \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '[
    {
      "quantity": 123,
      "sku": "booster_mega_1"
    }
  ]'

响应

已成功返回含商品的购物车。

正文application/json
cart_idstring

购物车ID。

示例: "cart_id"
is_freeboolean

如果为true,则购物车为免费。

itemsArray of objects(Cart_inline_response_200_items)
priceobject or null(Cart_inline_response_200_price)

购物车价格。

示例: "{\"amount\":\"6150.0000000000000000\",\"amount_without_discount\":\"6150.0000000000000000\",\"currency\":\"USD\"}"
warningsArray of objects(Cart_inline_response_200_1_warnings)
示例: [{"attributes":[],"description":"Take it, take it all! All of Xsollas riches in one Mega Booster.","groups":[{"external_id":"powerups","name":"Power Ups"}],"image_url":"https://cdn.xsolla.net/img/misc/images/e9f2f4a634bc96ea03b5d5ceadd7c55f.png","inventory_options":{"consumable":{"usages_count":1}},"is_free":false,"name":"Xsolla Booster Mega","price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"quantity":123,"sku":"booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[]}]
响应
application/json
{ "cart_id": "cart_id", "is_free": false, "items": [ {} ], "price": { "amount": "6150.0000000000000000", "amount_without_discount": "6150.0000000000000000", "currency": "USD" }, "warnings": [ {} ] }
操作
操作
操作
操作
操作
操作