Item attributes
Attributes are characteristics of an item that can provide additional information about the item.
An attribute can be the color and size of an item, the user level at which the item becomes available, or an event in a game.
Main features:
- Filtering items in the store
- Defining item variants (e.g., red helmet, blue helmet) and displaying them on the item card
- Assigning additional characteristics to an item
Examples of item attributes and their values:
Item type | Item attribute name | Item attribute value |
---|---|---|
Game keys | Game type | New, Early access, Coming Soon, Special |
Game keys | Genre | Action, Adventures, Casual, Simulator, Strategy, RPG |
Virtual items | Quality | Epic, Legendary, Common |
Virtual items | Class | Warrior, Paladin, Hunter, Shaman, Druid |
Virtual currency | Event | New year |
Virtual currency | Quest | Completing quest 1, Completing quest 2 |
How it works
- You create item attributes and their values and link them with the item:
- through Publisher Account or API by specifying the
External ID of the item attributes andExternal ID of the attribute values. - through Publisher Account by specifying attributes and their values in JSON format.
- You use methods from the Catalog subsection of the Virtual Items & Currency or Game Keys group of methods to request the item catalog. Attribute data is returned:
- In the attributes array if attributes are created through Publisher Account or via API methods by specifying the
External ID of the item attributes andExternal ID of the attribute values. - In the custom_attributes array if the attributes and values are added via JSON. To do this, you need to include the additional_fields parameter with the value
custom_attributes
in the catalog retrieval request.
- The user makes a purchase. If the attributes and values are added via JSON, the data about the item attributes is passed in the Successful payment of the order and Order cancellation webhooks in the custom_attributes array.
Integration flow
You can create item attributes and their values on your side and add them to the item in JSON format in Publisher Account.
You can also create attributes and their values on the Xolla’s side and add them to the items. To do this:
When adding item attributes and their values from JSON, there is a 500-character limit . There are no limitations on the number of attributes and values.
When creating attributes and their values in Publisher Account or through API methods, the following limitations apply:
- No more than 20 values can be specified for one item attribute
- No more than 20 attributes can be configured for each item
- One item can have several values of one attribute, but no more than 6
Creating and setting up item attributes and their values
Each item attribute has the following parameters:
External ID — is a unique attribute ID that is passed in the external_id parameter in the request body. Provide the attribute ID on your system or create a new one.- Name (specified for each language configured in the project).
List of values.
External ID of the parent item attribute.External ID of the value — a unique ID of the value passed in the external_id parameter in the path parameters. Specify the value ID in your system or create a new one.Name (specified for each language configured in the project).
Creating attributes and their values in Publisher Account
- Open your project in Publisher Account.
- Go to the Store > Catalog management.
- Click Configure in the Item attributes section.
- Click Create item attribute.
- Specify the
External ID and name of the item attribute. - Click Save and continue.
- Specify all necessary values for the created item attribute. For every value, specify the
External ID . To add more values, click +. - Click Save and continue.
The number of item attributes in the project is unlimited.
However, there is a limit of 20 values per attribute.
Creating attributes and their values via API methods
To create and manage item attributes and their values, use the methods in the Admin subsection of the Item attributes group of methods.
Methods for creating attributes and managing them:
Methods for creating attribute values and managing them:If you delete an item attribute, its values and connections with the item are lost.
If you delete a value, its connections with the item are lost.
You cannot restore deleted item attributes, values, or related data.
Adding attributes to an item
Add the created attributes and values to the items:
Adding existing attributes via Publisher Account
To add attributes to an item:- Open your project in Publisher Account.
- In the side menu, click Store.
- Open a section with the required item type:
- Virtual items
- Virtual currency
- Game keys
- Bundles
- Create a new item or edit the existing one.
- In the Item attributes section, switch the Select existing attributes or create new toggle to On.
- In the appeared Item attribute field, select the ID corresponding to the desired item attribute.
- In the Value field, select the ID that corresponds to the item attribute value.
You can’t set more than 20 attributes for an item.
You can’t specify more than 6 values of the same attribute for one item.
Adding existing attributes via API methods
In the Create virtual item or Update virtual item method, pass an array of objects with the
Example of an array with attributes and their values:
- http
"attributes": [
{
"external_id": "craft-materials",
"name": {
"en": "Craft materials"
},
"values": [
{
"external_id": "steel",
"value": {
"en-US": "5"
}
},
{
"external_id": "leather",
"value": {
"en-US": "1"
}
}
]
}
],
You can’t set more than 20 attributes for an item.
You can’t specify more than 6 values of the same attribute for one item.
Adding attributes from JSON via the Publisher Account
You can add attributes and their values in JSON format when creating or editing all types of items, such as:
To do this:
- Open your project in Publisher Account.
- In the side menu, click Store.
- Open a section with the required item type:
- Virtual items
- Virtual currency
- Game keys
- Bundles
- Create a new item or edit an existing one.
- In the Item attributes section, switch the Use JSON to add attributes toggle to On.
- In the displayed text area, add a list of attributes and their values in JSON format.
When adding attributes in JSON format, there is no limit on the number or their values.
There is a limitation on the maximum length of JSON — 500 characters.
Found a typo or other text error? Select the text and press Ctrl+Enter.