Purchase Inventory Items
Purchase an item or bundle. Up to 10,000 stacks of items can be added to a single inventory collection. Stack size is uncapped.
Error codes
This operation may return the following PlayFab errors:
| Error | Code |
|---|---|
| DatabaseThroughputExceeded | 1113 |
| InsufficientFunds | 1059 |
| InvalidCatalogItemConfiguration | 4015 |
| ItemNotFound | 1047 |
| PreconditionFailed | 1610 |
Authorizations
This API requires an Entity Session Token, available from the Entity GetEntityToken method.
Body
Purchase a single item or bundle, paying the associated price.
Purchase a single item or bundle, paying the associated price.
Indicates whether stacks reduced to an amount of 0 during the request should be deleted from the inventory. (Default=false)
The amount to purchase.
The id of the entity's collection to perform this action on. (Default="default"). The number of inventory collections is unlimited.
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).
The duration to purchase.
The entity to perform this action on.
ETags are used for concurrency checking when updating resources. More information about using ETags can be found here: https://learn.microsoft.com/en-us/gaming/playfab/features/economy-v2/catalog/etags
The Idempotency ID for this request. Idempotency IDs can be used to prevent operation replay in the medium term but will be garbage collected eventually.
The inventory item the request applies to.
The values to apply to a stack newly created by this request.
The per-item price the item is expected to be purchased at. This must match a value configured in the Catalog or specified Store.
The id of the Store to purchase the item from.
