Idea

marcos avatar image
marcos suggested

GrantItemsToUser to have Quantity

GrantItemsToUser currently does not allow to set the quantity to be granted and asumes is always one. Multiple requests have to be created and send in order to grant items in amounts higher than one.

In-Game Economy
10 |1200

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

3 Comments

·
Víctor avatar image
Víctor commented

I think this is a very much needed feature for a better and cleaner code.

Including the item's ID multiple times in the "ItemIds" array works pretty well, but it is not a great solution and it does not leave a very clean code in my opinion.

Thanks for posting it as a feature request!

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.

marcos avatar image marcos commented ·

Actually including the id multiple times is a great workaround that I had not realized about. I dont know if it will work for stackable items, but will definitively try it. Thanks for sharing thoughts.

0 Likes 0 ·
marcos avatar image
marcos commented

Thanks to @Víctor suggestion, I tried adding multiple times the same item id, and it works correctly, even with stackable items (remaining uses are properly incremented by the number of times the item id is introduced in the list).

So while this is not a very elegant approach, it does indeed work perfectly for the purpose, and thus the request is no longer regarding a missing feature. I tend to think the request can be disregarded.

10 |1200

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

Toni Palm avatar image
Toni Palm commented

The request is still valid, please don't remove it. It's super ugly to include the item multiple times. Also, it's probably related to the PlayFab internal limits which prevent you from granting LOTS of items in one call. They say you shouldn't give more than 50 or the request can time out.

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.

brendan avatar image brendan commented ·

We don't remove requests unless they're not valid for the service. The updated Commerce service we're working to release later this year will have more flexibility where this is concerned. Meanwhile, one other thing you could consider is using the ModifyItemUses API call to add larger numbers of an item to a stack.

0 Likes 0 ·

Write a Comment

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.