Xsolla-logo
  • 文档
  • 创建帐户

消耗商品

post/v2/project/{project_id}/user/inventory/item/consume

客户端端点。从当前用户物品库中消耗一个商品。

SecurityXsollaLoginUserJWT
Request
path Parameters
project_id
required
integer
Default: 44056

项目ID。

query Parameters
platform
string
Default: "xsolla"

用户玩游戏的发布平台。

Enum: "playstation_network" "xbox_live" "xsolla" "pc_standalone" "nintendo_shop" "google_play" "app_store_ios" "android_standalone" "ios_standalone" "android_other" "ios_other" "pc_other"
Request Body schema: application/json
sku
required
string
Default: "booster_mega_1"

唯一商品ID。 SKU只能包含小写英文字母和数字字符、句点、破折号和下划线。

quantity
required
number
Default: 1

商品数量。

Responses
200

用户物品库中的商品已被消耗。

404

完全找不到该商品,在物品库中找不到该商品,或者数量不够(尝试消耗的数量超过初始数量)。

422

请确保传递了quantitysku参数。

Request samples
application/json
{
  • "quantity": 1,
  • "sku": "booster_mega_1"
}
Response samples
{
  • "errorCode": 4001,
  • "errorMessage": "[0401-4001]: Item with Project Id = 44056 and Sku = gun_5 not found",
  • "statusCode": 404
}