Virtual items
How it works
Virtual items are in-game content that you can sell for real and virtual currency.
Main features:
- Set up prices in real and virtual currency.
- Configure catalog with several levels.
- Automatically determine the user’s currency and country.
Pricing configuration features:
- One item can have the price both in real and virtual currencies.
- You can set up prices in several real or virtual currencies. Make sure you selected a default currency in this case.
Pricing configuration restrictions:
- You can’t create an item without specifying its price in real or virtual currency.
- You can’t create an item with a zero value in price.
There are 3 types of virtual items:
Consumable virtual items
A consumable item is an item in the inventory that you can have in large quantities and purchase several times. Its quantity is decreased when users consume it.
Main features:
- Replenish the stock of items in the inventory.
- Store many instances of the same item in the user inventory.
- Can be consumed from the client side.
EXAMPLE: Grenades, bullets, etc.
Nonconsumable virtual items
A nonconsumable item is an item in the inventory that can be accrued or purchased only once.
Main features:
- Users can have only one unit of this item in the inventory.
- Can’t be removed from the inventory by being consumed on the client side. You can withdraw it only via a server method.
EXAMPLE: Access to a location, status, cosmetics, preinstalled
Nonrenewing subscriptions
A nonrenewing subscription is a one-time purchase. The user needs to buy it again when it expires.
Main features:
- Becomes inactive when it expires.
- The user buys this subscription again to activate it.
EXAMPLE:
See the nonrenewing subscriptions recipe for details.
Who can use it
- Partners who want to set up game economy or monetization by adding virtual currency to the game and selling virtual items for this currency.
- For partners who integrated In-Game Store and want to set up a new type of product – virtual items.
How to get it
Prerequisites
- Sign up to Xsolla Publisher Account.
- Open your project.
- Go to Project settings > Integration settings and make sure that the Integrate
Commerce API toggle is set to ON.
Integration flow
- Configure virtual items and groups of virtual items.
- Configure regional restrictions and regional prices.
Configure virtual items and groups of virtual items
To set up virtual items, you need to configure virtual items groups. Groups allow you to have a multilevel catalog. Items that don’t have a specified group are added to the
To set up virtual items and groups of virtual items, you can:
Configuration via Publisher Account
To set up groups of virtual items:
- Connect the Virtual Items module in Publisher Account.
- Go to Store > Virtual Items and click Create a group.
- Specify the following parameters:
- Group code.
- Group name.
- Set the Show group in Store toggle to ON.
- Click Create group.
To set up a virtual item:
- Connect the Virtual Items module in Publisher Account.
- Create an item.
- For every item, specify:
- Image.
- SKU.
- One or several groups the item should belong to.
- Name.
- Description.
- Item property: consumable, nonconsumable, or nonrenewing subscription.
- Prices in real or virtual currencies.
- Set the Show item in store toggle to ON.
- Click Create an item.
Configuration via API calls
Use API calls from the
Basic authorization is used for the API calls. Pass the
Use API calls from the
Use the
Configure regional restrictions and regional prices
To set up regional restrictions for virtual items, pass an array of objects with identifiers of regions where the item will be available to the
- http
"regions": [{
“id”: “123”
}, {
“id”: “456”
}
]
To set up regional prices for virtual items, pass an array of objects with regional prices settings to the
- http
"regional_prices": [{
“region_id”: “123”,
“country_iso”: “CHN”,
“amount”: 40,
“currency_iso”: “CNY”,
“is_default”: true,
“is_enabled”: true
}
]