Interface IEconomyCurrenciesApi
Represents a collection of functions to interact with the API endpoints
Namespace: Unity.Services.Apis.Economy
Assembly: Unity.Services.Apis.dll
Syntax
public interface IEconomyCurrenciesApi : IApiAccessor
Methods
DecrementPlayerCurrencyBalance(string, string, string, CurrencyModifyBalanceRequest, string, string, string, CancellationToken)
Decrement currency balance
Declaration
ApiOperation<CurrencyBalanceResponse> DecrementPlayerCurrencyBalance(string projectId, string playerId, string currencyId, CurrencyModifyBalanceRequest currencyModifyBalanceRequest, 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 | currencyId | Resource ID of the currency. |
Currency |
currencyModifyBalanceRequest | The modify balance 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 |
GetPlayerCurrencies(string, string, string, string, string, string, int?, CancellationToken)
Player currency balances
Declaration
ApiOperation<PlayerCurrencyBalanceResponse> GetPlayerCurrencies(string projectId, string playerId, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, string after = null, int? limit = 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 currency ID after which to retrieve the next page of balances. (optional) |
int? | limit | Number of currencies to be returned. Defaults to 20. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
IncrementPlayerCurrencyBalance(string, string, string, CurrencyModifyBalanceRequest, string, string, string, CancellationToken)
Increment currency balance
Declaration
ApiOperation<CurrencyBalanceResponse> IncrementPlayerCurrencyBalance(string projectId, string playerId, string currencyId, CurrencyModifyBalanceRequest currencyModifyBalanceRequest, 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 | currencyId | Resource ID of the currency. |
Currency |
currencyModifyBalanceRequest | The modify balance 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 |
SetPlayerCurrencyBalance(string, string, string, CurrencyBalanceRequest, string, string, string, CancellationToken)
Set currency balance
Declaration
ApiOperation<CurrencyBalanceResponse> SetPlayerCurrencyBalance(string projectId, string playerId, string currencyId, CurrencyBalanceRequest currencyBalanceRequest, 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 | currencyId | Resource ID of the currency. |
Currency |
currencyBalanceRequest | The currency balance 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 |