question

contact-18 avatar image
contact-18 asked

Economy v2 Give several different items at once. ( Like with GrantItemsToUsers)

hey how can you give the player multiple items with one request in economy v2? In the old system you could do that with GrantItemsToUsers.

Ok I found ExecuteInventoryOperations, but if I understand correctly I can call a maximum of 5 operations. So I can give a maximum of 5 different items to the player.

btw. here a json example would be very helpful.

https://learn.microsoft.com/en-us/gaming/playfab/features/economy-v2/inventory/?view=playfab-rest&tabs=inventory-game-manager#executeinventoryoperations-api

Player Inventory
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Simon Cui avatar image
Simon Cui answered

Yes. The API ExecuteInventoryOperations is designed to grant multiple items to a user. You can refer to this example below:

 {   "Entity": {
     "Id": "ABCD12345678",
     "Type": "title_player_account"
     },
   "Operations": [
     {
       "Add": {
         "Item": {
           "Id": "0d550fa4-5131-46a0-b201-2701c2432008"
         },
         "Amount": 1
       }
     },
     {
       "Add": {
         "Item": {
           "Id": "14ad8d0d-bea3-4194-a468-12ddcf6b24a9"
         },
         "Amount": 1
       }
     }, 
     {
       "Add": {
         "Item": {
           "Id": "2ac6ca38-fd12-42fc-a5a8-db533cc8524e"
         },
         "Amount": 1
       }
     },
         {
       "Add": {
         "Item": {
           "Id": "2ac6ca38-fd12-42fc-a5a8-db533cc8524e"
         },
         "Amount": 1
       }
     },
     {
       "Add": {
         "Item": {
           "Id": "2ac6ca38-fd12-42fc-a5a8-db533cc8524e"
         },
         "Amount": 1
       }
     }
   ]
 }
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

contact-18 avatar image
contact-18 answered

hey thanks for the info.

Is it planned that at some point you can use more than 5 operations?

GrantItemsToUsers could write more in any case.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Simon Cui avatar image Simon Cui commented ·

Hi, if you need this feature, you can post a thread in feature request forum: https://community.playfab.com/spaces/24/index.html

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.