Create and manage inventory configurations in the Admin Portal
The Inventory service is available but not yet recommended for production use. You are welcome to explore and try it, but please be aware that future updates may introduce breaking changes. For alternatives, consider the following:
- Entitlement: Recommended as the primary option for managing player items.
- Extend: If Entitlement does not fully cover your needs, consider Extend to build a custom solution.
Introduction
In the AccelByte Gaming Services (AGS) Inventory service, an inventory configuration contains a set of information and rules to determine the type of inventory that your players can use in-game.
This article walks you through how to create, update, and delete inventory configurations in the AGS Admin Portal or with the AGS CLI.
Prerequisites
- Access to the AGS Admin Portal.
- A publisher or a game namespace.
- You have reviewed the key concepts of the Inventory service and the Inventory service API documentation.
- To follow the AGS CLI steps, you have installed the AGS CLI and signed in with an account that has the permissions to manage inventory configurations. See Install and sign in. The examples use a Bash shell.
View inventory configurations
- Admin Portal
- AGS CLI
- On the AGS Admin Portal sidebar, go to Online > Inventory > Configurations. The Inventory Configurations page appears.
- From the inventory configurations list, find the configuration you want to view. You can search for inventories using their code. Click on the configuration's code to open to its details page.
-
List the inventory configurations in your namespace. To search by code, add
--code <InventoryCode>. Replace<YourNamespace>with your namespace.ags inventory inventory-definitions list --namespace <YourNamespace> -
To view one configuration, pass its
idfrom the list:ags inventory inventory-definitions get --namespace <YourNamespace> --inventory-configuration-id <InventoryConfigurationId>
Create inventory configuration
- Admin Portal
- AGS CLI
-
On the Inventory Configurations page, click on the Create Configuration button. The Create Configuration form appears.
-
On the form, fill in the required information:
- Inventory Code: type in an ID for the inventory.
- Inventory Name: type in a name for the inventory.
- Initial Slots: set the maximum number of slots a player can have to store their items, or tick the Set as Unlimited checkbox to set it to unlimited. Each slot can store a single non-stackable item or multiple identical items stacked as one.
- Maximum Slots Upgrade: set the maximum number of slots upgrade a player can own in the inventory, or tick the Set as Unlimited checkbox to set it to unlimited.
- Maximum Ownership: set the maximum number of inventory that a player can own per inventory.
- Description: provide a brief description or additional information describing the inventory configuration.
noteWhen you set Initial Slots with Unlimited configuration, it will automatically set the Maximum Slots Upgrade into Unlimited.
-
Click Create. The new inventory is added to the Inventory Configurations list.
-
Create a JSON file with the configuration's settings. Any file name works. This example uses
inventory-config.json:{
"code": "<InventoryCode>",
"name": "<InventoryName>",
"initialMaxSlots": 10,
"maxUpgradeSlots": 25,
"maxInstancesPerUser": 1,
"description": "<Description>"
}Admin Portal field Request body field Inventory Code codeInventory Name nameInitial Slots initialMaxSlotsMaximum Slots Upgrade maxUpgradeSlotsMaximum Ownership maxInstancesPerUserDescription descriptionTo make a slot field unlimited, the same as ticking Set as Unlimited in the Admin Portal, set it to
-1. If you setinitialMaxSlotsto-1, also setmaxUpgradeSlotsto-1, as the Admin Portal does. -
Create the configuration. After
@, pass the path to your JSON file:ags inventory inventory-definitions create --namespace <YourNamespace> --json @inventory-config.json
Update inventory configuration
If the status of an inventory configuration is INIT, you can update or edit all of its details. If its status is TIED, you can only update its Inventory Name and Description.
To update an inventory configuration, follow these steps:
- Admin Portal
- AGS CLI
- On the AGS Admin Portal sidebar, go to Online > Inventory > Configurations. The Inventory Configurations page appears.
- From the inventory configurations list, find the configuration you want to update. You can search for inventories using their code. Click on the configuration's code to open to its details page.
- To edit the value of any field, click on its edit (pencil) icon. Then, edit the value and click on the check button to save your changes in the field.
-
Save the configuration's current settings to a file:
ags inventory inventory-definitions get --namespace <YourNamespace> --inventory-configuration-id <InventoryConfigurationId> --format json > inventory-config.json -
In
inventory-config.json, edit the values you want to change. Keep the other fields as they are. -
Send the file back:
ags inventory inventory-definitions update --namespace <YourNamespace> --inventory-configuration-id <InventoryConfigurationId> --json @inventory-config.jsonwarningThe update replaces the whole configuration, so any field you leave out is cleared, including
name,description, and the slot fields. Always start from the saved file.
Delete inventory configuration
You can delete an inventory configuration when its status is INIT. Inventory configurations with the TIED status cannot be deleted.
To delete an inventory configuration, follow these steps:
- Admin Portal
- AGS CLI
- On the AGS Admin Portal sidebar, go to Online > Inventory > Configurations. The Inventory Configurations page appears.
- From the inventory configurations list, find the configuration you want to delete. You can search for inventories using their code. Click on the configuration's code to open to its details page.
- On the details page of the configuration, click on the Delete Configuration button and click on OK to delete the inventory. The inventory is immediately deleted from the Inventory Configurations page.
-
Find the
idof the configuration you want to delete:ags inventory inventory-definitions list --namespace <YourNamespace> -
Delete the configuration:
ags inventory inventory-definitions delete --namespace <YourNamespace> --inventory-configuration-id <InventoryConfigurationId>