跳转到内容

Metaverse Orbs API (1.0.0)

Metaverse Orbs API

下载 OpenAPI 描述
语言
服务器
http://orbs.babka.com/
Mock server
https://xsolla.redocly.app/_mock/zh/api/metaframe/
操作

Get multi virtual currencies balance

请求

Gets information about multi virtual currencies and shards balance.

安全
Bearer
路径
merchantIdstring必需

Merchant ID of the client

projectIdstring必需

Project ID of the project

curl -i -X GET \
  'http://orbs.babka.com/v2/merchants/{merchantId}/projects/{projectId}/multicurrency-balance' \
  -H 'Authorization: YOUR_API_KEY_HERE'

响应

Values of multi virtual crrencies balances.

正文application/json
itemsArray of objects(Balances)

List of multicurrency balances.

示例: [{"balance":14,"image_url":"https://imgurl.com","name":"Blue Orb Point","points":{"base":240,"point":80},"shards":2,"virtual_currency_sku":"xxxxx"}]
items[].​balanceinteger

Multicurrency balance.

items[].​image_urlstring

Multicurrency image url.

items[].​is_allowable_to_buyboolean

To distingush between partially available and available status of virtual currency

items[].​namestring

Multicurrency name.

items[].​pointsobject

Shards balance in time points.

items[].​points.​baseinteger

Shard base, number of time points in one Multicurrency.

items[].​points.​pointinteger

Shard balance in time points.

items[].​shardsinteger

Shard balance.

items[].​virtual_currency_skustring

Multicurrency sku.

响应
application/json
{ "items": [ {} ] }

Topup user's multicurrency balance

请求

Top up user multicurrency balance.

安全
Server
路径
merchantIdstring必需

Merchant ID of the client

projectIdstring必需

Project ID of the project

标头
X-OPERATION-IDstring(UUID)= 36 characters必需

Unique operation ID.

X-HOST-IDstring(UUID)= 36 characters必需

Unique operator ID.

正文application/json
shardsinteger(int64)>= 1必需

Number of Shards to topup.

示例: 22
user_idstring(UUID)non-empty必需

Xsolla Account ID.

示例: "b8fa3003-2448-49fb-bbe2-7f72f420e350"
virtual_currency_skustringnon-empty必需

Multicurrency SKU

示例: "sapphire_point"
curl -i -X POST \
  'http://orbs.babka.com/v2/merchants/{merchantId}/projects/{projectId}/multicurrency-balance-topup' \
  -H 'Content-Type: application/json' \
  -H 'X-HOST-ID: stringstringstringstringstringstring' \
  -H 'X-OPERATION-ID: stringstringstringstringstringstring' \
  -H 'X-SERVER-AUTHORIZATION: YOUR_API_KEY_HERE' \
  -d '{
    "shards": 22,
    "user_id": "b8fa3003-2448-49fb-bbe2-7f72f420e350",
    "virtual_currency_sku": "sapphire_point"
  }'

响应

Operation successful

正文application/json
balanceobject
示例: {"balance":1,"shards":5}
balance.​balanceinteger

Multicurrency balance.

示例: 1
balance.​shardsinteger

Multicurrency Shards balance.

示例: 5
响应
application/json
{ "balance": { "balance": 1, "shards": 5 } }

Retrieve info about automatic purchase

请求

Retrieve information about automatic purchase.

安全
Server
路径
merchantIdstring必需

Merchant ID of the client

projectIdstring必需

Project ID of the project

userIdstring(UUID)= 36 characters必需

Unique User ID.

标头
X-HOST-IDstring(UUID)= 36 characters必需

Unique operator ID.

curl -i -X GET \
  'http://orbs.babka.com/v2/merchants/{merchantId}/projects/{projectId}/user/{userId}/auto-topup' \
  -H 'X-HOST-ID: stringstringstringstringstringstring' \
  -H 'X-SERVER-AUTHORIZATION: YOUR_API_KEY_HERE'

响应

Information about automatic purchase.

正文application/json
itemsArray of objects(Item)
示例: [{"enabled":false,"virtual_currency_sku":"xxx-xxx-xxx"}]
items[].​enabledboolean必需

Whether automatic purchase of multicurrency is enabled for the user.

items[].​virtual_currency_skustring必需

Virtual Currency SKU

响应
application/json
{ "items": [ {} ] }

Update info about automatic purchase

请求

Updates information about automatic purchase.

安全
Server
路径
merchantIdstring必需

Merchant ID of the client

projectIdstring必需

Project ID of the project

userIdstring(UUID)= 36 characters必需

Unique User ID.

标头
X-HOST-IDstring(UUID)= 36 characters必需

Unique operator ID.

正文application/json
itemsArray of objects(Item)
示例: [{"enabled":false,"virtual_currency_sku":"xxx-xxx-xxx"}]
items[].​enabledboolean

Whether automatic purchase of Blue Orbs is enabled for the user.

items[].​virtual_currency_skustring必需

Virtual Currency SKU.

curl -i -X PUT \
  'http://orbs.babka.com/v2/merchants/{merchantId}/projects/{projectId}/user/{userId}/auto-topup' \
  -H 'Content-Type: application/json' \
  -H 'X-HOST-ID: stringstringstringstringstringstring' \
  -H 'X-SERVER-AUTHORIZATION: YOUR_API_KEY_HERE' \
  -d '{
    "items": [
      {
        "enabled": false,
        "virtual_currency_sku": "xxx-xxx-xxx"
      }
    ]
  }'

响应

Information about automatic purchase.

正文application/json
itemsArray of objects(Item)
示例: [{"enabled":false,"virtual_currency_sku":"xxx-xxx-xxx"}]
items[].​enabledboolean必需

Whether automatic purchase of multicurrency is enabled for the user.

items[].​virtual_currency_skustring必需

Virtual Currency SKU

响应
application/json
{ "items": [ {} ] }
操作
操作
操作