Xsolla-logo

Consume item

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

Client endpoint. Consumes an item from the current user’s inventory.

SecurityXsollaLoginUserJWT
Request
path Parameters
project_id
required
integer
Default: 44056

Project ID.

query Parameters
platform
string
Default: "playstation_network"

Publishing platform the user plays on.

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"

Unique item ID. The SKU may only contain lowercase Latin alphanumeric characters, periods, dashes, and underscores.

quantity
required
number
Default: 1

Item quantity. If item is uncountable, should be null.

instance_id
required
string
Default: null

Instance item ID. If item is countable, should be null.

Responses
200

Item from the user’s inventory was consumed.

404

The item was not found at all, the item was not found in the inventory, or it is not enough (attempt to consume more than the initial number). instance_id must be 32 characters long.

422

Both instance_id and quantity are passed. Make sure that only one parameter is passed (instance_id or quantity). instance_id must be 32 characters long.

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