Interface IEconomyInventoryApi
Represents a collection of functions to interact with the API endpoints
Namespace: Unity.Services.Apis.Economy
Assembly: Unity.Services.Apis.dll
Syntax
public interface IEconomyInventoryApi : IApiAccessor
Methods
AddInventoryItem(string, string, AddInventoryRequest, string, string, string, CancellationToken)
Add inventory item
Declaration
ApiOperation<InventoryResponse> AddInventoryItem(string projectId, string playerId, AddInventoryRequest addInventoryRequest, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
Add |
addInventoryRequest | The add inventory item request. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
DeleteInventoryItem(string, string, string, string, string, string, string, InventoryDeleteRequest, CancellationToken)
Delete player's inventory item
Declaration
ApiOperation DeleteInventoryItem(string projectId, string playerId, string playersInventoryItemId, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, string writeLock = null, InventoryDeleteRequest inventoryDeleteRequest = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
string | playersInventoryItemId | The |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
string | writeLock | The writelock for a database entry. (optional) |
Inventory |
inventoryDeleteRequest | (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
GetPlayerInventory(string, string, string, string, string, string, int?, List<string>, List<string>, CancellationToken)
List player inventory
Declaration
ApiOperation<PlayerInventoryResponse> GetPlayerInventory(string projectId, string playerId, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, string after = null, int? limit = null, List<string> playersInventoryItemIds = null, List<string> inventoryItemIds = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
string | after | The |
int? | limit | Number of items to be returned. Defaults to 20. (optional) |
List<string> | playersInventoryItemIds | List of |
List<string> | inventoryItemIds | List of inventory item IDs in array notation, for example, |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
UpdateInventoryItem(string, string, string, InventoryRequestUpdate, string, string, string, CancellationToken)
Update player's inventory item
Declaration
ApiOperation<InventoryResponse> UpdateInventoryItem(string projectId, string playerId, string playersInventoryItemId, InventoryRequestUpdate inventoryRequestUpdate, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
string | playersInventoryItemId | The |
Inventory |
inventoryRequestUpdate | The update inventory item request. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |