Documentation

GetCharacterInventory

Retrieves the specified character's current inventory of virtual goods

Request Details

All items currently in the character inventory will be returned, irrespective of how they were acquired (via purchasing, grants, coupons, etc.). Items that are expired, fully consumed, or are no longer valid are not considered to be in the user's current inventory, and so will not be not included. Also returns their virtual currency balances.

GetCharacterInventoryRequest
Request Properties
CatalogVersion String

Used to limit results to only those from a specific catalog version.

CharacterId (required) String

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

PlayFabId (required) String

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

POST https://{{TitleID}}.playfabapi.com/Server/GetCharacterInventory
    Content-Type: application/json
    X-SecretKey: <developer_secret_key>
{
  "PlayFabId": "204883457",
  "CharacterId": "9890723423",
  "CatalogVersion": "5"
}
        

Response Details

GetCharacterInventoryResult
Result Properties
CharacterId String

Unique identifier of the character for this inventory.

Inventory List<ItemInstance>

Array of inventory items belonging to the character.

PlayFabId String

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

VirtualCurrency Dict<String, int32>

Array of virtual currency balance(s) belonging to the character.

VirtualCurrencyRechargeTimes Dict<String, VirtualCurrencyRechargeTime>

Array of remaining times and timestamps for virtual currencies.

Sample Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
  "code": 200,
  "status": "OK",
  "data": {
    "PlayFabId": "204883457",
    "CharacterId": "9890723423",
    "Inventory": [
      {
        "ItemId": "shield_level_5",
        "ItemInstanceId": "9879843",
        "ItemClass": "shields",
        "CatalogVersion": "5",
        "UnitPrice": 0
      },
      {
        "ItemId": "energy_boost_1",
        "ItemInstanceId": "3854637",
        "ItemClass": "boosts",
        "RemainingUses": 4,
        "CatalogVersion": "5",
        "UnitPrice": 0
      }
    ],
    "VirtualCurrency": {
      "GC": 15
    },
    "VirtualCurrencyRechargeTimes": {
      "GC": {
        "SecondsToRecharge": 3600,
        "RechargeTime": "2014-01-01T12:00:00Z",
        "RechargeMax": 50
      }
    }
  }
}

Authentication

SecretKey

Possible Error Codes

Name Code
CharacterNotFound 1135