跳转到内容

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/
操作

请求

用商品填充购物车。如果购物车中已有具有相同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": [ {} ] }

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

请求

从购物车中删除一个商品。

安全
AuthForClient
路径
project_idinteger必需

项目ID。

示例: 44056
item_skustring必需

商品SKU。

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

响应

购物车中的商品已成功删除。

响应
无内容

更新当前购物车的商品

请求

更新现有的购物车商品或在购物车中创建商品。

安全
basicAuth
路径
project_idinteger必需

项目ID。

示例: 44056
item_skustring必需

商品SKU。

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

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

quantitynumber

商品数量。

默认值 123
curl -i -X PUT \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/zh/api/digital-distribution-hub/v2/project/44056/cart/item/booster_mega_1 \
  -H 'Content-Type: application/json' \
  -d '{
    "currency": "string",
    "quantity": 123
  }'

响应

购物车已成功更新。

响应
无内容
操作
操作
操作
操作
操作
操作