The inventory is what a player owns: the quantity of each item of your catalog. An item is either consumable (used up, like a potion) or durable (kept, like a sword, often limited to one). This page lists an inventory, grants items for free and consumes them. To sell an item for coins, use Purchases. The examples on this page continue from the setup.
The list holds owned items only: an item the player has used up (quantity 0) is not listed. The SDKs return the array of items directly (inventory.list), without the items wrapper.
sku is the key of the item in your catalog: see Get the catalog for its name, type, price and limit.
Gives items to a player for free: a reward, a gift, a compensation. Nothing is debited. It is for your backend only: the client API can never give an item.
An unknown field; sku empty or longer than 48 characters; quantity not an integer between 1 and 10¹²; a key that is not 1 to 100 printable ASCII characters
Read details.fieldErrors.
403
PLAYER_BLOCKED
The player is blocked
Nothing can be written for this player until the player is unblocked.
404
NOT_FOUND
The item is not in the catalog (or is archived), or a GameCoin id does not exist
Replay. The same key with the same request returns the original response again, with the header Idempotent-Replayed: true, and changes nothing.
A grant adds to what the player owns; it never replaces it. Granting 3 potions to a player who owns 2 leaves them with 5.
A limit is all or nothing: a grant that would pass maxOwned is refused entirely, not cut down to fit. For an item with maxOwned: 1, grant it once.
The SDKs return the inventory item with a replayed flag (Replayed in Go and C#) that is true when the answer is the replay of an earlier request with the same key.
The first write on an unknown ext: player creates it.
Removes units of a consumable item: the player drinks a potion, you take a ticket. Use it when your game confirms the use of an item, so that the inventory stays the source of truth.
An unknown field; sku empty or longer than 48 characters; quantity not an integer between 1 and 10¹²; a key that is not 1 to 100 printable ASCII characters
Read details.fieldErrors.
403
PLAYER_BLOCKED
The player is blocked
Nothing can be written for this player until the player is unblocked.
404
NOT_FOUND
The item is not in the catalog, or a GameCoin id does not exist
Replay. The same key with the same request returns the original response again, with the header Idempotent-Replayed: true, and changes nothing.
Not owning the item at all is the same as owning 0: it answers INSUFFICIENT_FUNDS with available: 0. The code is the one of the wallet, here applied to a quantity of items.
A consumption is all or nothing: asking for more than the player owns consumes nothing.
An item that reaches 0 stays out of List the inventory, but its last quantity is in the response so that your game can show it.
The browser can consume too, with the player's own token: Consume an item in the client API.