playfab economy inventory, including
collections, transaction history, and batched inventory operations.
Inventory commands target the calling entity unless you pass both --entity-id and
--entity-type. For a player, pass their title player account ID with
--entity-type title_player_account, not their master player account ID;
playfab player account get returns it as
UserInfo.TitleInfo.TitlePlayerAccount.Id. --collection-id selects an inventory
collection other than default.
operation execute refuses a batch that contains a Delete operation unless you pass
--confirm (--yes, -y), even in a terminal. Other inventory changes run without asking.
See Safety and destructive operations.
Inventory items
inventory listreturns one page of--limititems, 10 by default. To get the next page, pass the response’s continuation token with--continuation-token.--filteris an OData filter over the item propertiestype,id, andstackId.inventory addreturnsETag,IdempotencyId, and theTransactionIdsit recorded, not the changed inventory. Runinventory listto see the result.
Inventory collections
Inventory operations
operation execute runs the batch as one transaction. Like inventory add, it returns
ETag, IdempotencyId, and TransactionIds for the whole batch. Run inventory list or
inventory transaction list to see what it did.
operation status checks an inventory transfer that hadn’t finished when its request
returned. TransferInventoryItems and ExecuteTransferOperations return an
OperationToken while their OperationStatus is InProgress; pass that token, and the
transfer’s GivingEntity as --entity-id and --entity-type. The CLI has no command for
those transfer APIs, so call them with playfab api. A transaction ID isn’t an
operation token, and PlayFab rejects one with Bad OperationToken.
Inventory transactions
--filter can refer to timestamp, transactionid, apiname, and operationtype.
--order-by accepts timestamp asc or timestamp desc.
Table output
These commands accept--output table; inventory add and operation execute don’t. See
Table output.
A table doesn’t show the continuation token, so use JSON output to page past the first
page.
Examples
Read one player’s inventory, collections, and transaction history:ops.json:
ops.json contains a Delete operation, add --confirm:
"OperationStatus": "InProgress", using the
OperationToken from its response and the player who gave the items:
