GS2-Inventory SDK for Game Engine API Reference

Specifications of models and API references for GS2-Inventory SDK for Game Engine

Model

EzInventory

Inventory

Inventory is like a bag that stores items owned by game players. The bag has a capacity, and the capacity can be expanded by each player.

TypeConditionRequiredDefaultValue LimitsDescription
inventoryIdstring
*
~ 1024 charsInventory GRN
* Set automatically by the server
inventoryNamestring
~ 128 charsInventory Model Name
The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits.
currentInventoryCapacityUsageint00 ~ 2147483646Capacity Usage
The number of inventory slots currently occupied by item sets. Incremented when a new item stack is added (e.g., when allowMultipleStacks creates a new slot) and decremented when an item set is fully consumed or deleted. Cannot exceed currentInventoryMaxCapacity.
currentInventoryMaxCapacityint
1 ~ 2147483646Maximum Capacity
The current maximum number of inventory slots available to this user. Initialized from the inventory model’s initialCapacity and can be expanded up to the model’s maxCapacity through acquire actions or direct API calls.

EzItemSet

Item Set

Item Set represents the possessions stored in the game player’s inventory. Item Set holds the Inventory Model name, Item Model name, quantity held, expiration time, and other details.

TypeConditionRequiredDefaultValue LimitsDescription
itemSetIdstring
*
~ 1024 charsItem Set GRN
* Set automatically by the server
namestring
UUID~ 36 charsName identifying the Item Set
Maintains a unique name for each item set.
Names are automatically generated in UUID (Universally Unique Identifier) format and used to identify each item set.
inventoryNamestring
~ 128 charsInventory Model Name
The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to.
itemNamestring
~ 128 charsItem Model Name
The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set.
countlong
1 ~ 9223372036854775805Quantity in Possession
The number of items in this stack. Ranges from 1 to the item model’s stacking limit. When items are acquired, this count increases up to the stacking limit; when consumed, it decreases. If count reaches 0, the item set is deleted and the inventory slot is freed.
sortValueint
0 ~ 2147483646Display Order
A numeric value copied from the item model’s sortValue, used to sort item sets within the inventory for display purposes. Lower values are displayed first.
expiresAtlong0Expiration time
Unix time, milliseconds
referenceOfList<string>[]0 ~ 24 itemsList of References
The external references registered on this item set. Used to track which systems are using this item (e.g., equipped as weapon, assigned to formation). Up to 24 references per item set.

EzSimpleItem

Simple Item

Simple Item represents a possession stored in the game player’s inventory. Simple Item has a model name and the quantity possessed.

TypeConditionRequiredDefaultValue LimitsDescription
itemIdstring
*
~ 1024 charsSimple Item GRN
* Set automatically by the server
itemNamestring
~ 128 charsSimple Item Model Name
The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to.
countlong
0 ~ 9223372036854775805Quantity in Possession
The number of this item type held by the user. Unlike standard inventory items, simple items have no stacking limit and the count can be any value within the int64 range. Can be increased or decreased through batch operations along with other simple items.

EzBigItem

Big Item

Big item represents possessions stored in the game player’s Big Inventory. Big Items can hold quantities beyond the range of int64.

TypeConditionRequiredDefaultValue LimitsDescription
itemIdstring
*
~ 1024 charsBig Item GRN
* Set automatically by the server
itemNamestring
~ 128 charsBig Item Model Name
The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to.
countstring
BigInteger (Unity)
~ 1024 charsQuantity in possession
Integer value strings up to 1024 digits

EzInventoryModel

Inventory Model

Inventory is like a bag that stores items owned by game players. Inventory can have a set capacity and cannot be owned beyond its capacity.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsInventory Model name
Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.
initialCapacityint
0 ~ 2147483646Initial Capacity
The number of inventory slots available to a user when the inventory is first created. Each slot can hold one item stack. Users can expand their capacity up to maxCapacity through gameplay actions.
maxCapacityint
0 ~ 2147483646Maximum Capacity
The upper limit of inventory slots that a user can expand to. Capacity cannot be increased beyond this value. When all slots are occupied and items cannot be stacked further, acquisition attempts will fail unless the overflow script handles the excess.

EzItemModel

Item Model

Items can be held in groups within a single inventory slot, such as Potion ×99. This grouping of multiple items into one slot is called “stacking,” and a maximum stack size can be set for each item.

The behavior when the stack limit is reached can also be set for each item. Specifically, you can choose one of the following:

  • Add a new inventory slot to allow further acquisition
  • Prevent further acquisition once the limit is reached
TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsItem Model name
Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 2048 charsMetadata
GS2-Enhance features a mechanism that works in conjunction with GS2-Inventory to perform enhancements. It sets the experience value when used as enhancement material in JSON format within the ItemModel metadata.
Details are explained in the Microservices Introduction / GS2-Enhance section.
stackingLimitlong
1 ~ 9223372036854775805Maximum Stackable Quantity
The maximum number of this item that can be held in a single inventory slot (stack). When this limit is reached, the behavior depends on the allowMultipleStacks setting: either a new slot is allocated or further acquisition is blocked.
allowMultipleStacksbool
Allow Multiple Stacks
When enabled, if the stacking limit is reached, a new inventory slot is automatically allocated to store additional quantities of this item (consuming additional capacity). When disabled, acquisition is blocked once the stacking limit is reached in the existing slot.
sortValueint
0 ~ 2147483646Display Order
A numeric value used to sort items within the inventory for display purposes. Lower values are displayed first. This value is also copied to ItemSet records to enable consistent ordering of possessed items.

EzSimpleInventoryModel

Simple Inventory Model

In a normal InventoryModel, you could limit the amount of items that could be stored in your inventory. Simple Inventory, however, has no such functionality and simply stores the number of items in the inventory.

However, the Simple Inventory provides APIs that allow increasing or decreasing multiple items in a single operation.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsSimple Inventory Model name
Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.

EzSimpleItemModel

Simple Item Model

ItemModel allowed setting a maximum stackable quantity, enabling implementation where items exceeding a certain number could be split into multiple stacks. SimpleItem does not have such a function and simply stores the number of items in the possession of the item.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsSimple Item Model name
Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.

EzBigInventoryModel

Big Inventory Model

In the normal InventoryModel and SimpleInventoryModel, the number of items that can be stored in the inventory is limited to the range of int64. In inflationary games, you may need a wider range of values.

In the Big Inventory Model, the number of items that can be stored in the inventory can have an integer value of 1024 digits.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsBig Inventory Model name
Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.

EzBigItemModel

Big Item Model

The Big Item Model defines items stored in a Big Inventory Model. Big Items can hold quantities that exceed the range of int64.

TypeConditionRequiredDefaultValue LimitsDescription
namestring
~ 128 charsBig Item Model name
Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
metadatastring~ 2048 charsMetadata
Arbitrary values can be set in the metadata.
Since they do not affect GS2’s behavior, they can be used to store information used in the game.

EzConsumeCount

Consumption quantity of Simple Item

TypeConditionRequiredDefaultValue LimitsDescription
itemNamestring
~ 128 charsSimple Item Model Name
The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to.
countlong
1 ~ 9223372036854775805Consumption quantity

EzAcquireCount

Acquisition quantity of Simple Item

TypeConditionRequiredDefaultValue LimitsDescription
itemNamestring
~ 128 charsSimple Item Model Name
The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to.
countlong
1 ~ 9223372036854775805Acquisition quantity

Methods

getInventoryModel

Get a specific inventory type definition by name

Retrieves a single inventory model by specifying its name. The returned information includes the initial and maximum capacity, item protection settings, and all item models that belong to this inventory. Use this to display the details of a specific inventory type — for example, showing “Equipment Bag — Capacity: 50/100 — Items: Iron Sword, Steel Shield, Leather Armor, …”.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsInventory Model name
Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemEzInventoryModelInventory Model

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->InventoryModel(
        "item" // inventoryName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->InventoryModel(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FInventoryModel> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listInventoryModels

Get a list of inventory type definitions

Retrieves all inventory models registered in this namespace. An inventory model defines a container type for items — such as “Equipment Bag”, “Material Pouch”, or “Consumable Box”. Each model sets the initial and maximum capacity (how many different item types it can hold), and includes the list of item models (what items can be stored in it). Use this to display what kinds of inventories the player has — for example, showing tabs like “Equipment (50/100 slots)”, “Materials (30/200 slots)”.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<EzInventoryModel>List of Inventory Models

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    var items = await domain.InventoryModelsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.InventoryModels(
    );
    List<EzInventoryModel> items = new List<EzInventoryModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    );
    const auto It = Domain->InventoryModels(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzInventoryModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeInventoryModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeInventoryModels(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeInventoryModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeInventoryModels(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeInventoryModels(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeInventoryModels(CallbackId);

getItemModel

Get a specific item definition by name

Retrieves a single item model by specifying the inventory name and item name. The returned information includes the maximum stack size, whether the item supports multiple stacks (e.g., items with different expiration dates are stored in separate stacks), and the sort order. Use this to display item rules — for example, showing “Healing Potion — Max per stack: 99 — Can have multiple stacks with different expiration dates”.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsInventory Model name
Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
itemNamestring
~ 128 charsItem Model name
Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemEzItemModel

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    ).ItemModel(
        itemName: "item-master-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    ).ItemModel(
        itemName: "item-master-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->InventoryModel(
        "item" // inventoryName
    )->ItemModel(
        "item-master-0001" // itemName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    ).ItemModel(
        itemName: "item-master-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    ).ItemModel(
        itemName: "item-master-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->InventoryModel(
        "item" // inventoryName
    )->ItemModel(
        "item-master-0001" // itemName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FItemModel> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listItemModels

Get a list of item definitions in an inventory

Retrieves all item models that belong to the specified inventory. An item model defines the rules for a specific item type — such as the maximum stack size (e.g., potions stack up to 99), whether items can be split into multiple stacks, and the sort order for display. Use this to show what types of items can exist in an inventory — for example, listing all equipment types in the “Equipment Bag” or all materials in the “Material Pouch”.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsInventory Model name
Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<EzItemModel>List of Item Model

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    );
    var items = await domain.ItemModelsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    );
    var it = domain.ItemModels(
    );
    List<EzItemModel> items = new List<EzItemModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->InventoryModel(
        "item" // inventoryName
    );
    const auto It = Domain->ItemModels(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzItemModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeItemModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeItemModels(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).InventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeItemModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeItemModels(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->InventoryModel(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeItemModels(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeItemModels(CallbackId);

getInventory

Get a specific inventory’s details

Retrieves the details of a specific inventory by name, including the current capacity usage (used slots / max slots). Use this to display a specific inventory’s status — for example, showing “Equipment Bag — 45 / 100 slots used” at the top of the equipment inventory screen.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsInventory Model Name
The name of the inventory model that defines the structure and capacity settings for this inventory. Links the user’s inventory instance to its model definition, determining available item types and capacity limits.
gameSessionGameSession
GameSession

Result

TypeDescription
itemEzInventoryInventory

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "inventory-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "inventory-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Inventory(
        "inventory-0001" // inventoryName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "inventory-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "inventory-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Inventory(
        "inventory-0001" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FInventory> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listInventories

Get a list of the player’s inventories

Retrieves all inventories that belong to the player. Each inventory shows its current capacity usage — how many item types (slots) are currently used out of the maximum capacity. Use this to build an inventory overview screen — for example, showing “Equipment Bag: 45/100 slots used”, “Material Pouch: 120/200 slots used” as a list of the player’s item containers.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gameSessionGameSession
GameSession
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<EzInventory>List of Inventories
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var items = await domain.InventoriesAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var it = domain.Inventories(
    );
    List<EzInventory> items = new List<EzInventory>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    );
    const auto It = Domain->Inventories(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzInventoryPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    
    // Start event handling
    var callbackId = domain.SubscribeInventories(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeInventories(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    
    // Start event handling
    var callbackId = domain.SubscribeInventories(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeInventories(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeInventories(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeInventories(CallbackId);

consume

Use (consume) items from the player’s inventory

Reduces the quantity of a specific item in the player’s inventory. Use this when the player uses or spends items through game-specific logic. For example, use this when the player uses a healing potion in battle, consumes crafting materials, or spends items on a custom game feature. Note: if items are consumed as a cost for purchasing products (GS2-Showcase) or starting quests (GS2-Quest), those systems handle item consumption automatically — you don’t need to call this API for those cases. You can optionally specify which stack (itemSetName) to consume from. If omitted, items are consumed from the oldest stack first.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsInventory Model Name
The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to.
itemNamestring
~ 128 charsItem Model Name
The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set.
gameSessionGameSession
GameSession
consumeCountlong
1 ~ 9223372036854775805Consumption quantity
itemSetNamestring~ 36 charsName identifying the Item Set

Result

TypeDescription
itemsList<EzItemSet>List of Item Sets per post-consumption
itemModelEzItemModelItem Model
inventoryEzInventoryInventory

Error

Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.

TypeBase TypeDescription
ConflictExceptionConflictExceptionItem manipulation process conflicted. Retry required.
InsufficientExceptionBadRequestExceptionInsufficient quantity of items in your possession.

Implementation Example

try {
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "inventory-0001"
    ).ItemSet(
        itemName: "item-0001",
        itemSetName: null
    );
    var result = await domain.ConsumeAsync(
        consumeCount: 1L
    );
    var item = await result.ModelAsync();
} catch(Gs2.Gs2Inventory.Exception.ConflictException e) {
    // Item manipulation process conflicted. Retry required.
} catch(Gs2.Gs2Inventory.Exception.InsufficientException e) {
    // Insufficient quantity of items in your possession.
}
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "inventory-0001"
    ).ItemSet(
        itemName: "item-0001",
        itemSetName: null
    );
    var future = domain.ConsumeFuture(
        consumeCount: 1L
    );
    yield return future;
    if (future.Error != null)
    {
        if (future.Error is Gs2.Gs2Inventory.Exception.ConflictException)
        {
            // Item manipulation process conflicted. Retry required.
        }
        if (future.Error is Gs2.Gs2Inventory.Exception.InsufficientException)
        {
            // Insufficient quantity of items in your possession.
        }
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Inventory(
        "inventory-0001" // inventoryName
    )->ItemSet(
        "item-0001", // itemName
        nullptr // itemSetName
    );
    const auto Future = Domain->Consume(
        1L // consumeCount
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        auto e = Future->GetTask().Error();
        if (e->IsChildOf(Gs2::Inventory::Error::FConflictError::Class))
        {
            // Item manipulation process conflicted. Retry required.
        }
        if (e->IsChildOf(Gs2::Inventory::Error::FInsufficientError::Class))
        {
            // Insufficient quantity of items in your possession.
        }
        return false;
    }

    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();

getItem

Get a specific item by inventory name and item name

Retrieves all stacks of a specific item type that the player owns in the specified inventory. The response may contain multiple stacks (item sets) for the same item — items with different expiration dates are always in separate stacks. For example, requesting “Healing Potion” might return two stacks: one with 50 potions expiring soon and another with 30 potions expiring later. Use this to display an item detail screen — for example, showing “Healing Potion — Total: 80 — Stack 1: 50 (expires 2024-03-01), Stack 2: 30 (expires 2024-03-15)”.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsInventory Model Name
The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to.
itemNamestring
~ 128 charsItem Model Name
The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set.
gameSessionGameSession
GameSession

Result

TypeDescription
itemsList<EzItemSet>List of Item Sets
itemModelEzItemModelItem Model
inventoryEzInventoryinventory

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "item"
    ).ItemSet(
        itemName: "item-0001",
        itemSetName: "itemSet-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "item"
    ).ItemSet(
        itemName: "item-0001",
        itemSetName: "itemSet-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Inventory(
        "item" // inventoryName
    )->ItemSet(
        "item-0001", // itemName
        "itemSet-0001" // itemSetName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "item"
    ).ItemSet(
        itemName: "item-0001",
        itemSetName: "itemSet-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "item"
    ).ItemSet(
        itemName: "item-0001",
        itemSetName: "itemSet-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Inventory(
        "item" // inventoryName
    )->ItemSet(
        "item-0001", // itemName
        "itemSet-0001" // itemSetName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FItemSet> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

getItemWithSignature

Get an item with a cryptographic signature proving ownership

Retrieves an item set along with a server-signed signature that proves the player owned this item at the time of the API call. This is useful when you need to verify item ownership on an external server or another system — the signature serves as tamper-proof evidence. For example, you can use this to verify that a player actually owns a specific weapon before allowing them to enter a special dungeon.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsInventory Model Name
The name of the inventory model that contains this item set. Used together with itemName to identify which inventory and item type this possession belongs to.
itemNamestring
~ 128 charsItem Model Name
The name of the item model that defines the type of item stored in this set. Combined with inventoryName, it determines the stacking limit and multi-stack behavior for this item set.
gameSessionGameSession
GameSession
itemSetNamestring~ 36 charsName identifying the Item Set
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsEncryption Key GRN

Result

TypeDescription
itemsList<EzItemSet>List of Item Sets
itemModelEzItemModelItem Model
inventoryEzInventoryInventory
bodystringItem Set Information for Signature Subject
signaturestringSignature

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "inventory-0001"
    ).ItemSet(
        itemName: "item-0001",
        itemSetName: null
    );
    var result = await domain.GetItemWithSignatureAsync(
        keyId: "key-0001"
    );
    var item = await result.ModelAsync();
    var body = result.Body;
    var signature = result.Signature;
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "inventory-0001"
    ).ItemSet(
        itemName: "item-0001",
        itemSetName: null
    );
    var future = domain.GetItemWithSignatureFuture(
        keyId: "key-0001"
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;
    var body = future.Result.Body;
    var signature = future.Result.Signature;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Inventory(
        "inventory-0001" // inventoryName
    )->ItemSet(
        "item-0001", // itemName
        nullptr // itemSetName
    );
    const auto Future = Domain->GetItemWithSignature(
        "key-0001" // keyId
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }

    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();
    const auto Body = Result->Body;
    const auto Signature = Result->Signature;

listItems

Get a list of items the player owns in an inventory

Retrieves all items that the player currently owns in the specified inventory. Each entry is an “item set” — a stack of items with a quantity and optionally an expiration date. The same item type can appear as multiple stacks if it has different expiration dates. For example, “Healing Potion” might show up as two entries: “Healing Potion x50 (expires in 3 days)” and “Healing Potion x30 (expires in 7 days)”. Use this to build the main item list screen for an inventory — showing all owned items with their quantities.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsInventory Model name
Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gameSessionGameSession
GameSession
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<EzItemSet>List of Item Sets
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "item"
    );
    var items = await domain.ItemSetsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "item"
    );
    var it = domain.ItemSets(
    );
    List<EzItemSet> items = new List<EzItemSet>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Inventory(
        "item" // inventoryName
    );
    const auto It = Domain->ItemSets(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzItemSetPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeItemSets(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeItemSets(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Inventory(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeItemSets(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeItemSets(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Inventory(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeItemSets(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeItemSets(CallbackId);

getSimpleInventoryModel

Get a specific simple inventory type definition by name

Retrieves a single simple inventory model by specifying its name. The returned information includes the list of simple item models that belong to this inventory — defining what items can be stored and their properties. Use this to display what a specific simple inventory contains — for example, showing the item types in a “Currency” or “Materials” inventory.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsSimple Inventory Model name
Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemEzSimpleInventoryModelSimple Inventory Model

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->SimpleInventoryModel(
        "item" // inventoryName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->SimpleInventoryModel(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FSimpleInventoryModel> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listSimpleInventoryModels

Get a list of simple inventory type definitions

Retrieves all simple inventory models registered in this namespace. A simple inventory is a lightweight version of the standard inventory — it stores items as simple name-and-count pairs without stacking, expiration dates, or capacity limits. Simple inventories are ideal for resources like currencies, crafting materials, or any item that just needs a count — for example, “Gold: 5000”, “Iron Ore: 150”, “Stamina Potion: 12”. Use this to see what types of simple inventories are available in the game.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<EzSimpleInventoryModel>List of Simple Inventory Models

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    var items = await domain.SimpleInventoryModelsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.SimpleInventoryModels(
    );
    List<EzSimpleInventoryModel> items = new List<EzSimpleInventoryModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    );
    const auto It = Domain->SimpleInventoryModels(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzSimpleInventoryModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeSimpleInventoryModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeSimpleInventoryModels(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeSimpleInventoryModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeSimpleInventoryModels(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeSimpleInventoryModels(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeSimpleInventoryModels(CallbackId);

getSimpleItemModel

Get a specific simple item definition by name

Retrieves a single simple item model by specifying the inventory name and item name. Use this to display the definition of a specific simple item type — for example, to show the properties of “Gold” or “Iron Ore” in the game UI.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsSimple Inventory Model name
Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
itemNamestring
~ 128 charsSimple Item Model name
Simple Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemEzSimpleItemModel

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    ).SimpleItemModel(
        itemName: "item-master-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    ).SimpleItemModel(
        itemName: "item-master-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->SimpleInventoryModel(
        "item" // inventoryName
    )->SimpleItemModel(
        "item-master-0001" // itemName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    ).SimpleItemModel(
        itemName: "item-master-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    ).SimpleItemModel(
        itemName: "item-master-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->SimpleInventoryModel(
        "item" // inventoryName
    )->SimpleItemModel(
        "item-master-0001" // itemName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FSimpleItemModel> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listSimpleItemModels

Get a list of simple item definitions in an inventory

Retrieves all simple item models that belong to the specified simple inventory. A simple item model defines a single item type that is tracked by count only — no stacking rules, no expiration, just a name and a number. Use this to see what items can exist in a simple inventory — for example, listing “Gold”, “Gems”, “Iron Ore”, “Wood” in the “Materials” inventory.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsSimple Inventory Model name
Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<EzSimpleItemModel>List of Simple Item Model

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    );
    var items = await domain.SimpleItemModelsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    );
    var it = domain.SimpleItemModels(
    );
    List<EzSimpleItemModel> items = new List<EzSimpleItemModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->SimpleInventoryModel(
        "item" // inventoryName
    );
    const auto It = Domain->SimpleItemModels(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzSimpleItemModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeSimpleItemModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeSimpleItemModels(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).SimpleInventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeSimpleItemModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeSimpleItemModels(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->SimpleInventoryModel(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeSimpleItemModels(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeSimpleItemModels(CallbackId);

consumeSimpleItems

Use (consume) simple items from the player’s inventory

Reduces the quantity of one or more simple items in the player’s inventory. You can consume multiple item types at once in a single call. Use this when the player spends resources through game-specific logic — for example, spending crafting materials to forge a weapon, or using consumable items in battle. Note: if items are consumed as a cost for purchasing products (GS2-Showcase) or starting quests (GS2-Quest), those systems handle item consumption automatically — you don’t need to call this API for those cases.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsSimple Inventory Model name
Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gameSessionGameSession
GameSession
consumeCountsList<EzConsumeCount>
1 ~ 100 itemsList of consumption quantities of Simple Items

Result

TypeDescription
itemsList<EzSimpleItem>List of Simple Items per post-consumption

Error

Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.

TypeBase TypeDescription
ConflictExceptionConflictExceptionItem manipulation process conflicted. Retry required.
InsufficientExceptionBadRequestExceptionInsufficient quantity of items in your possession.

Implementation Example

try {
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "inventory-0001"
    );
    var result = await domain.ConsumeSimpleItemsAsync(
        consumeCounts: new List<Gs2.Unity.Gs2Inventory.Model.EzConsumeCount> {
            new Gs2.Unity.Gs2Inventory.Model.EzConsumeCount() {
                ItemName = "item-0001",
                Count = 5,
            },
            new Gs2.Unity.Gs2Inventory.Model.EzConsumeCount() {
                ItemName = "item-0002",
                Count = 3,
            },
        }
    );
    var item = await result.ModelAsync();
} catch(Gs2.Gs2Inventory.Exception.ConflictException e) {
    // Item manipulation process conflicted. Retry required.
} catch(Gs2.Gs2Inventory.Exception.InsufficientException e) {
    // Insufficient quantity of items in your possession.
}
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "inventory-0001"
    );
    var future = domain.ConsumeSimpleItemsFuture(
        consumeCounts: new List<Gs2.Unity.Gs2Inventory.Model.EzConsumeCount> {
            new Gs2.Unity.Gs2Inventory.Model.EzConsumeCount() {
                ItemName = "item-0001",
                Count = 5,
            },
            new Gs2.Unity.Gs2Inventory.Model.EzConsumeCount() {
                ItemName = "item-0002",
                Count = 3,
            },
        }
    );
    yield return future;
    if (future.Error != null)
    {
        if (future.Error is Gs2.Gs2Inventory.Exception.ConflictException)
        {
            // Item manipulation process conflicted. Retry required.
        }
        if (future.Error is Gs2.Gs2Inventory.Exception.InsufficientException)
        {
            // Insufficient quantity of items in your possession.
        }
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->SimpleInventory(
        "inventory-0001" // inventoryName
    );
    const auto Future = Domain->ConsumeSimpleItems(
        []
        {
            auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Inventory::Model::FEzConsumeCount>>>();
            v->Add(
                MakeShared<Gs2::UE5::Inventory::Model::FEzConsumeCount>()
                ->WithItemName(TOptional<FString>("item-0001"))
                ->WithCount(TOptional<int32>(5))
            );
            v->Add(
                MakeShared<Gs2::UE5::Inventory::Model::FEzConsumeCount>()
                ->WithItemName(TOptional<FString>("item-0002"))
                ->WithCount(TOptional<int32>(3))
            );
            return v;
        }() // consumeCounts
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        auto e = Future->GetTask().Error();
        if (e->IsChildOf(Gs2::Inventory::Error::FConflictError::Class))
        {
            // Item manipulation process conflicted. Retry required.
        }
        if (e->IsChildOf(Gs2::Inventory::Error::FInsufficientError::Class))
        {
            // Insufficient quantity of items in your possession.
        }
        return false;
    }

    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();

getSimpleItem

Get the count of a specific simple item

Retrieves how many of a specific simple item the player currently owns. Use this to check a specific resource amount — for example, displaying “Gold: 5,000” on the shop screen before a purchase, or “Iron Ore: 150/200 needed” on the crafting screen.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsSimple Inventory Model name
Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
itemNamestring
~ 128 charsSimple Item Model Name
The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to.
gameSessionGameSession
GameSession

Result

TypeDescription
itemEzSimpleItemSimple Item
itemModelEzSimpleItemModelSimple Item Model

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "item"
    ).SimpleItem(
        itemName: "item-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "item"
    ).SimpleItem(
        itemName: "item-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->SimpleInventory(
        "item" // inventoryName
    )->SimpleItem(
        "item-0001" // itemName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "item"
    ).SimpleItem(
        itemName: "item-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "item"
    ).SimpleItem(
        itemName: "item-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->SimpleInventory(
        "item" // inventoryName
    )->SimpleItem(
        "item-0001" // itemName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FSimpleItem> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

getSimpleItemWithSignature

Get a simple item with a cryptographic signature proving ownership

Retrieves a simple item along with a server-signed signature that proves the player owned this item at the time of the API call. This is useful when you need to verify item ownership on an external server or another system — the signature serves as tamper-proof evidence. For example, you can use this to verify that a player has enough currency or materials before processing a trade on an external marketplace.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsSimple Inventory Model name
Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
itemNamestring
~ 128 charsSimple Item Model Name
The name of the simple item model that defines the type of item stored in this record. Used to identify which item definition this possession corresponds to.
gameSessionGameSession
GameSession
keyIdstring“grn:gs2:{region}:{ownerId}:key:default:key:default”~ 1024 charsEncryption Key GRN

Result

TypeDescription
itemEzSimpleItemSimple Item
simpleItemModelEzSimpleItemModelSimple Item Model
bodystringSimple Item Information for Signature Subject
signaturestringSignature

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "inventory-0001"
    ).SimpleItem(
        itemName: "item-0001"
    );
    var result = await domain.GetSimpleItemWithSignatureAsync(
        keyId: "key-0001"
    );
    var item = await result.ModelAsync();
    var body = result.Body;
    var signature = result.Signature;
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "inventory-0001"
    ).SimpleItem(
        itemName: "item-0001"
    );
    var future = domain.GetSimpleItemWithSignatureFuture(
        keyId: "key-0001"
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;
    var body = future.Result.Body;
    var signature = future.Result.Signature;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->SimpleInventory(
        "inventory-0001" // inventoryName
    )->SimpleItem(
        "item-0001" // itemName
    );
    const auto Future = Domain->GetSimpleItemWithSignature(
        "key-0001" // keyId
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }

    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();
    const auto Body = Result->Body;
    const auto Signature = Result->Signature;

listSimpleItems

Get a list of simple items the player owns in an inventory

Retrieves all simple items that the player currently owns in the specified simple inventory. Each item is a simple name-and-count pair — for example, “Gold: 5000”, “Iron Ore: 150”. Unlike standard inventory items, simple items have no stacking, expiration, or slot limits. Use this to display a resource or material list — for example, showing the player’s currency balance, crafting materials, or consumable counts.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsSimple Inventory Model name
Simple Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gameSessionGameSession
GameSession
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<EzSimpleItem>List of Simple Items
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "item"
    );
    var items = await domain.SimpleItemsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "item"
    );
    var it = domain.SimpleItems(
    );
    List<EzSimpleItem> items = new List<EzSimpleItem>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->SimpleInventory(
        "item" // inventoryName
    );
    const auto It = Domain->SimpleItems(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzSimpleItemPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeSimpleItems(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeSimpleItems(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).SimpleInventory(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeSimpleItems(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeSimpleItems(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->SimpleInventory(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeSimpleItems(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeSimpleItems(CallbackId);

getBigInventoryModel

Get a specific big inventory type definition by name

Retrieves a single big inventory model by specifying its name. The returned information includes the list of big item models that belong to this inventory. Use this to display the details of a specific big inventory type — for example, showing what items are tracked in the “Mega Currency” or “Accumulated Points” inventory.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsBig Inventory Model name
Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemEzBigInventoryModelBig Inventory Model

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->BigInventoryModel(
        "item" // inventoryName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->BigInventoryModel(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FBigInventoryModel> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listBigInventoryModels

Get a list of big inventory type definitions

Retrieves all big inventory models registered in this namespace. A big inventory is designed for items that can have extremely large quantities — beyond what normal integers can handle (e.g., billions or trillions). This is useful for idle/incremental game currencies, accumulated points, or any resource that can grow to very large numbers. Use this to see what types of big inventories are available in the game.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<EzBigInventoryModel>List of Big Inventory Models

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    var items = await domain.BigInventoryModelsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.BigInventoryModels(
    );
    List<EzBigInventoryModel> items = new List<EzBigInventoryModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    );
    const auto It = Domain->BigInventoryModels(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzBigInventoryModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeBigInventoryModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeBigInventoryModels(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeBigInventoryModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeBigInventoryModels(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeBigInventoryModels(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeBigInventoryModels(CallbackId);

getBigItemModel

Get a specific big item definition by name

Retrieves a single big item model by specifying the inventory name and item name. Use this to display the definition of a specific big item type — for example, to show the properties of “Mega Gold” or “Lifetime XP” in the game UI.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsBig Inventory Model name
Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
itemNamestring
~ 128 charsBig Item Model name
Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemEzBigItemModel

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    ).BigItemModel(
        itemName: "item-master-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    ).BigItemModel(
        itemName: "item-master-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->BigInventoryModel(
        "item" // inventoryName
    )->BigItemModel(
        "item-master-0001" // itemName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    ).BigItemModel(
        itemName: "item-master-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    ).BigItemModel(
        itemName: "item-master-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->BigInventoryModel(
        "item" // inventoryName
    )->BigItemModel(
        "item-master-0001" // itemName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FBigItemModel> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listBigItemModels

Get a list of big item definitions in an inventory

Retrieves all big item models that belong to the specified big inventory. A big item model defines an item type that can hold extremely large quantities using arbitrary-precision numbers (stored as strings instead of integers). Use this to see what items can exist in a big inventory — for example, listing “Mega Gold”, “Lifetime XP”, “Total Damage Dealt” in the game.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsBig Inventory Model name
Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).

Result

TypeDescription
itemsList<EzBigItemModel>List of Big Item Model

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    );
    var items = await domain.BigItemModelsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    );
    var it = domain.BigItemModels(
    );
    List<EzBigItemModel> items = new List<EzBigItemModel>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->BigInventoryModel(
        "item" // inventoryName
    );
    const auto It = Domain->BigItemModels(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzBigItemModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeBigItemModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeBigItemModels(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).BigInventoryModel(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeBigItemModels(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeBigItemModels(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->BigInventoryModel(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeBigItemModels(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeBigItemModels(CallbackId);

consumeBigItem

Use (consume) a big item from the player’s inventory

Reduces the quantity of a specific big item in the player’s inventory. The consume count is specified as a string to support extremely large values. Use this when the player spends big-number resources through game-specific logic — for example, spending “1,000,000,000 Mega Gold” on a prestige upgrade or consuming accumulated points. Note: if items are consumed as a cost for purchasing products (GS2-Showcase) or starting quests (GS2-Quest), those systems handle item consumption automatically — you don’t need to call this API for those cases.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsBig Inventory Model name
Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
itemNamestring
~ 128 charsBig Item Model name
Big Item Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gameSessionGameSession
GameSession
consumeCountstring
~ 1024 charsConsumption quantity of a Big Item
Integer value strings up to 1024 digits

Result

TypeDescription
itemEzBigItemBig Item per post-consumption

Error

Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.

TypeBase TypeDescription
ConflictExceptionConflictExceptionItem manipulation process conflicted. Retry required.
InsufficientExceptionBadRequestExceptionInsufficient quantity of items in your possession.

Implementation Example

try {
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "inventory-0001"
    ).BigItem(
        itemName: "item-0001"
    );
    var result = await domain.ConsumeBigItemAsync(
        consumeCount: "1234567890123456789012345678901234567890"
    );
    var item = await result.ModelAsync();
} catch(Gs2.Gs2Inventory.Exception.ConflictException e) {
    // Item manipulation process conflicted. Retry required.
} catch(Gs2.Gs2Inventory.Exception.InsufficientException e) {
    // Insufficient quantity of items in your possession.
}
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "inventory-0001"
    ).BigItem(
        itemName: "item-0001"
    );
    var future = domain.ConsumeBigItemFuture(
        consumeCount: "1234567890123456789012345678901234567890"
    );
    yield return future;
    if (future.Error != null)
    {
        if (future.Error is Gs2.Gs2Inventory.Exception.ConflictException)
        {
            // Item manipulation process conflicted. Retry required.
        }
        if (future.Error is Gs2.Gs2Inventory.Exception.InsufficientException)
        {
            // Insufficient quantity of items in your possession.
        }
        onError.Invoke(future.Error, null);
        yield break;
    }
    var future2 = future.Result.ModelFuture();
    yield return future2;
    if (future2.Error != null)
    {
        onError.Invoke(future2.Error, null);
        yield break;
    }
    var result = future2.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->BigInventory(
        "inventory-0001" // inventoryName
    )->BigItem(
        "item-0001" // itemName
    );
    const auto Future = Domain->ConsumeBigItem(
        "1234567890123456789012345678901234567890" // consumeCount
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        auto e = Future->GetTask().Error();
        if (e->IsChildOf(Gs2::Inventory::Error::FConflictError::Class))
        {
            // Item manipulation process conflicted. Retry required.
        }
        if (e->IsChildOf(Gs2::Inventory::Error::FInsufficientError::Class))
        {
            // Insufficient quantity of items in your possession.
        }
        return false;
    }

    // obtain changed values / result values
    const auto Future2 = Future->GetTask().Result()->Model();
    Future2->StartSynchronousTask();
    if (Future2->GetTask().IsError())
    {
        return Future2->GetTask().Error();
    }
    const auto Result = Future2->GetTask().Result();

getBigItem

Get the count of a specific big item

Retrieves the current count of a specific big item the player owns. The count is returned as a string to support extremely large values. Use this to check a specific big-number resource — for example, displaying “Mega Gold: 1,234,567,890” on the game’s main screen or “Lifetime XP: 9,876,543,210” on the player profile.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsBig Inventory Model name
Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
itemNamestring
~ 128 charsBig Item Model Name
The name of the big item model that defines the type of item stored in this record. Used to identify which item definition this big item possession corresponds to.
gameSessionGameSession
GameSession

Result

TypeDescription
itemEzBigItemBig Item
itemModelEzBigItemModelBig Item Model

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "item"
    ).BigItem(
        itemName: "item-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "item"
    ).BigItem(
        itemName: "item-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->BigInventory(
        "item" // inventoryName
    )->BigItem(
        "item-0001" // itemName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "item"
    ).BigItem(
        itemName: "item-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "item"
    ).BigItem(
        itemName: "item-0001"
    );
    
    // Start event handling
    var callbackId = domain.Subscribe(
        value => {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->BigInventory(
        "item" // inventoryName
    )->BigItem(
        "item-0001" // itemName
    );
    
    // Start event handling
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Inventory::Model::FBigItem> value) {
            // Called when the value changes
            // The "value" is passed the value after the change.
        }
    );

    // Stop event handling
    Domain->Unsubscribe(CallbackId);

listBigItems

Get a list of big items the player owns in an inventory

Retrieves all big items that the player currently owns in the specified big inventory. Each item has a count stored as a string to support extremely large numbers (e.g., “1234567890123456789”). Items that have never been acquired will not appear in the results. Use this to display the player’s big-number resources — for example, showing “Mega Gold: 1,234,567,890” or “Total Damage: 9,876,543,210,000”.

Request

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
inventoryNamestring
~ 128 charsBig Inventory Model name
Big Inventory Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
gameSessionGameSession
GameSession
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data items to retrieve

Result

TypeDescription
itemsList<EzBigItem>List of Quantity of Big Items
nextPageTokenstringPage token to retrieve the rest of the listing

Implementation Example

    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "item"
    );
    var items = await domain.BigItemsAsync(
    ).ToListAsync();
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "item"
    );
    var it = domain.BigItems(
    );
    List<EzBigItem> items = new List<EzBigItem>();
    while (it.HasNext())
    {
        yield return it.Next();
        if (it.Error != null)
        {
            onError.Invoke(it.Error, null);
            break;
        }
        if (it.Current != null)
        {
            items.Add(it.Current);
        }
        else
        {
            break;
        }
    }
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->BigInventory(
        "item" // inventoryName
    );
    const auto It = Domain->BigItems(
    );
    TArray<Gs2::UE5::Inventory::Model::FEzBigItemPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
Value change event handling
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeBigItems(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeBigItems(callbackId);
    var domain = gs2.Inventory.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).BigInventory(
        inventoryName: "item"
    );
    
    // Start event handling
    var callbackId = domain.SubscribeBigItems(
        () => {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    domain.UnsubscribeBigItems(callbackId);
    const auto Domain = Gs2->Inventory->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->BigInventory(
        "item" // inventoryName
    );
    
    // Start event handling
    const auto CallbackId = Domain->SubscribeBigItems(
        []() {
            // Called when an element of the list changes.
        }
    );

    // Stop event handling
    Domain->UnsubscribeBigItems(CallbackId);