跳转到内容

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

更新当前购物车的商品

请求

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

安全
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
  }'

响应

购物车已成功更新。

响应
无内容

请求

按购物车ID返回用户的购物车。

安全
AuthForClient
路径
project_idinteger必需

项目ID。

示例: 44056
cart_idstring必需

购物车ID。

示例: custom_id
查询
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/custom_id?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" } }

按购物车ID删除所有购物车商品

请求

删除所有购物车商品。

安全
AuthForClient
路径
project_idinteger必需

项目ID。

示例: 44056
cart_idstring必需

购物车ID。

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

响应

购物车已成功清空。

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