Purchase multiple inventory items using MakeVirtualPurchaseAsync

I’d like to create a Virtual Purchase for converting for example 50 gems to 100 inventory items (not currency). This seems impossible, as the maximum amount you can specify in the .ecv file for “rewards” is 10.

We have an “amount” field in our customData for all inventory items and we manually manage the amounts for non-currency items. I can add “amount” as customData in the VP, but I assume there’s no Cloud Code callback for processing virtual purchases so that I could merge the purchased item into an existing item instead of creating a duplicate item?

Hello!
You can bypass the “10” reward limit for converting 50 gems to 100 inventory items by leveraging Cloud Code. Instead of directly granting the items, set up your virtual purchase to consume the gems and then trigger a Cloud Code function. This server-side function will check the player’s inventory, and if the item already exists, it will update its customData “amount” field; otherwise, it will grant a new item with the desired starting amount.

Hi!

I thought about that, but I want to avoid a situation where the game consumes the gems and then due whatever possible reason then fails to grant the items to the player if the Cloud Code call fails (network error for example).