Documentation

GetUserInventory

Retrieves the user's current inventory of virtual goods

Request Details

GetUserInventoryRequest
Request Properties
POST https://{{TitleID}}.playfabapi.com/Client/GetUserInventory
    Content-Type: application/json
    X-Authentication: <user_session_ticket_value>
{}
        

Response Details

All items currently in the user 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.

GetUserInventoryResult
Result Properties
Inventory List<ItemInstance>

Array of inventory items belonging to the user.

VirtualCurrency Dict<String, int32>

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

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": {
    "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

SessionTicket

Possible Error Codes

Name Code