Documentation

ConsumeItem

Consume uses of a consumable item. When all uses are consumed, it will be removed from the player's inventory.

Request Details

ConsumeItemRequest
Request Properties
CharacterId String

Unique PlayFab assigned ID for a specific character owned by a user

ConsumeCount (required) int32

Number of uses to consume from the item.

ItemInstanceId (required) String

Unique instance identifier of the item to be consumed.

PlayFabId (required) String

Unique PlayFab assigned ID of the user on whom the operation will be performed.

POST https://{{TitleID}}.playfabapi.com/Server/ConsumeItem
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "ItemInstanceId": "94585729",
  "ConsumeCount": 1
}
        

Response Details

ConsumeItemResult
Result Properties
ItemInstanceId String

Unique instance identifier of the item with uses consumed.

RemainingUses (required) int32

Number of uses remaining on the item.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8


Authentication

SecretKey

Possible Error Codes

Name Code
AccountNotFound 1001
CharacterNotFound 1135
InvalidItemProperties 1091
ItemNotFound 1047
NoRemainingUses 1062