question

omar avatar image
omar asked

StartPurchase limit

If I use a big quantity to purchase items:

{ 
   "CatalogVersion" : "1", 
   "Items" : [ 
      { 
         "ItemId" : "touchdownPowerUpLessEnemies", 
         "Quantity" : "26"
      }
   ]
}

then it returns this error:

{ 
   "code" : "400", 
   "status" : "BadRequest", 
   "error" : "InvalidParams", 
   "errorCode" : "1000", 
   "errorMessage" : "Invalid quantity in cart: item ID=touchdownPowerUpTackle"
}

Everything is fine if I use 25 or less as a quantity, but more than 25 is invalid. I want to know why? and if there is a limit, where can I change it?

10 |1200

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

1 Answer

·
brendan avatar image
brendan answered

What is it you're trying to do specifically? If the goal is to sell a player a bundle of 25 of an item, you can use a Bundle in the Catalog to set that up (it's also worth noting that the item in question should probably be stackable, if the player can get multiples of it).

Grant and purchase operations shouldn't be trying to add large number of distinct items, as there's a significant performance hit with very large inventory operations. We have a few updates we're working on to optimize inventory performance overall, but because inventory must be reliably transactional, it will always be more expensive of an operation, resource-wise, than updating player data, for example.

2 comments
10 |1200

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

omar avatar image omar commented ·

They are stackable, and the player can use credits to buy them, any amount, not 25, it could be from 1 up to the amount of credits that he has, that could be thousands.

We can just divide the number by 25 and make several calls to get the total amount, but I think this is more heavy performance-wise than buying 100 of stackable ones at a time.

0 Likes 0 ·
brendan avatar image brendan omar commented ·

That's the kind of thing we're looking to address with the inventory updates we're working on right now. We've already made some updates, and more will be coming over the next few weeks. Long story short, what you're describing isn't supported right now, as it would cause undue load and result in bad delays on your inventory calls (possibly timeouts, if you're trying to do thousands). But we are actively working on the code to address this - when that update is complete, we'll be posting a write-up of the changes so that everyone is aware.

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.