UXsollaInventorySubsystem

Inherits from UGameInstanceSubsystem

Public Functions

Name
UXsollaInventorySubsystem ()
virtual voidInitialize (FSubsystemCollectionBase & Collection) override
virtual voidDeinitialize () override
voidInitialize (const FString & InProjectId)
Initialize the controller with provided Project ID (use to override project settings)
voidGetInventory (const FString & AuthToken, const EXsollaPublishingPlatform Platform, const FOnInventoryUpdate & SuccessCallback, const FOnError & ErrorCallback, const int Limit =50, const int Offset =0)
Returns a list of virtual items from the user’s inventory according to pagination settings.
voidGetVirtualCurrencyBalance (const FString & AuthToken, const EXsollaPublishingPlatform Platform, const FOnCurrencyBalanceUpdate & SuccessCallback, const FOnError & ErrorCallback)
Returns the current user’s balance of virtual currency.
voidGetTimeLimitedItems (const FString & AuthToken, const EXsollaPublishingPlatform Platform, const FOnTimeLimitedItemsUpdate & SuccessCallback, const FOnError & ErrorCallback)
Returns a list of time-limited items from the user’s inventory.
voidConsumeInventoryItem (const FString & AuthToken, const FString & ItemSKU, const int32 Quantity, const FString & InstanceID, const EXsollaPublishingPlatform Platform, const FOnInventoryRequestSuccess & SuccessCallback, const FOnError & ErrorCallback)
Consumes an inventory item.
voidGetCouponRewards (const FString & AuthToken, const FString & CouponCode, const FOnCouponRewardsUpdate & SuccessCallback, const FOnError & ErrorCallback)
Returns a list of items that can be credited to the user when the coupon is redeemed.
voidRedeemCoupon (const FString & AuthToken, const FString & CouponCode, const FOnCouponRedeemUpdate & SuccessCallback, const FOnError & ErrorCallback)
Redeems the coupon code and delivers a reward to the user.
static boolIsItemInInventory (const FInventoryItemsData & Inventory, const FString & ItemSKU, FInventoryItem & FoundItem)
Checks if the certain item is in the inventory.

Protected Functions

Name
voidGetInventory_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnInventoryUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
voidGetVirtualCurrencyBalance_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnCurrencyBalanceUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
voidGetTimeLimitedItems_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnTimeLimitedItemsUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
voidConsumeInventoryItem_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnInventoryRequestSuccess SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
voidUpdateCouponRewards_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnCouponRewardsUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)
voidRedeemCoupon_HttpRequestComplete (FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, const bool bSucceeded, FOnCouponRedeemUpdate SuccessCallback, FErrorHandlersWrapper ErrorHandlersWrapper)

Protected Attributes

Name
FStringProjectID
Cached Xsolla Store project id.

Public Functions Documentation

function UXsollaInventorySubsystem

Copy
Full screen
Small screen
1UXsollaInventorySubsystem()

function Initialize

Copy
Full screen
Small screen
1virtual void Initialize(
2    FSubsystemCollectionBase & Collection
3) override

function Deinitialize

Copy
Full screen
Small screen
1virtual void Deinitialize() override

function Initialize

Copy
Full screen
Small screen
1void Initialize(
2    const FString & InProjectId
3)

Initialize the controller with provided Project ID (use to override project settings)

Parameters:

  • InProjectId New Project ID value from Publisher Account. It can be found in Publisher Account next to the name of your project.

function GetInventory

Copy
Full screen
Small screen
1void GetInventory(
2    const FString & AuthToken,
3    const EXsollaPublishingPlatform Platform,
4    const FOnInventoryUpdate & SuccessCallback,
5    const FOnError & ErrorCallback,
6    const int Limit =50,
7    const int Offset =0
8)

Returns a list of virtual items from the user’s inventory according to pagination settings.

Parameters:

  • AuthToken User authorization token obtained during authorization using Xsolla Login (more about authorization options ).
  • Platform Publishing platform the user plays on.

Can be xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, or pc_other.

  • SuccessCallback Called after purchased virtual items were successfully received.
  • ErrorCallback Called after the request resulted with an error.
  • Limit Limit for the number of elements on the page. The maximum number of elements on a page is 50.
  • Offset Number of the element from which the list is generated (the count starts from 0).

For each virtual item, complete data is returned. Attention: The number of items returned in a single response is limited. The default and maximum value is 50 items per response. To get more data page by page, use Limit and Offset fields. More about the use cases .

function GetVirtualCurrencyBalance

Copy
Full screen
Small screen
1void GetVirtualCurrencyBalance(
2    const FString & AuthToken,
3    const EXsollaPublishingPlatform Platform,
4    const FOnCurrencyBalanceUpdate & SuccessCallback,
5    const FOnError & ErrorCallback
6)

Returns the current user’s balance of virtual currency.

Parameters:

  • AuthToken User authorization token obtained during authorization using Xsolla Login (more about authorization options ).
  • Platform Publishing platform the user plays on.

Can be xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, or pc_other.

  • SuccessCallback Called after virtual currency balance was successfully received.
  • ErrorCallback Called after the request resulted with an error.

For each virtual currency, complete data is returned. More about the use cases .

function GetTimeLimitedItems

Copy
Full screen
Small screen
1void GetTimeLimitedItems(
2    const FString & AuthToken,
3    const EXsollaPublishingPlatform Platform,
4    const FOnTimeLimitedItemsUpdate & SuccessCallback,
5    const FOnError & ErrorCallback
6)

Returns a list of time-limited items from the user’s inventory.

Parameters:

  • AuthToken User authorization token obtained during authorization using Xsolla Login (more about authorization options ).
  • Platform Publishing platform the user plays on.

Can be xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, or pc_other.

  • SuccessCallback Called after list of user time limited items was successfully received.
  • ErrorCallback Called after the request resulted with an error.

For each item, complete data is returned. More about the use cases .

function ConsumeInventoryItem

Copy
Full screen
Small screen
1void ConsumeInventoryItem(
2    const FString & AuthToken,
3    const FString & ItemSKU,
4    const int32 Quantity,
5    const FString & InstanceID,
6    const EXsollaPublishingPlatform Platform,
7    const FOnInventoryRequestSuccess & SuccessCallback,
8    const FOnError & ErrorCallback
9)

Consumes an inventory item.

Parameters:

  • AuthToken User authorization token obtained during authorization using Xsolla Login (more about authorization options ).
  • ItemSKU Desired item SKU.
  • Quantity Item quantity. If the item is uncountable, should be zero.
  • InstanceID Instance item ID. If the item is countable, should be empty.
  • Platform Publishing platform the user plays on.

Can be xsolla (default), playstation_network, xbox_live, pc_standalone, nintendo_shop, google_play, app_store_ios, android_standalone, ios_standalone, android_other, ios_other, or pc_other.

  • SuccessCallback Called after successful inventory item consumption.
  • ErrorCallback Called after the request resulted with an error.

Use for only for consumable virtual items. More about the use cases .

function GetCouponRewards

Copy
Full screen
Small screen
1void GetCouponRewards(
2    const FString & AuthToken,
3    const FString & CouponCode,
4    const FOnCouponRewardsUpdate & SuccessCallback,
5    const FOnError & ErrorCallback
6)

Returns a list of items that can be credited to the user when the coupon is redeemed.

Parameters:

  • AuthToken User authorization token obtained during authorization using Xsolla Login (more about authorization options ).
  • CouponCode Unique case sensitive code. Contains letters and numbers.
  • SuccessCallback Called after receiving coupon rewards successfully.
  • ErrorCallback Called after the request resulted with an error.

Can be used to let users choose one of many items as a bonus. The usual case is choosing a DRM if the coupon contains a game as a bonus. More about the use cases .

function RedeemCoupon

Copy
Full screen
Small screen
1void RedeemCoupon(
2    const FString & AuthToken,
3    const FString & CouponCode,
4    const FOnCouponRedeemUpdate & SuccessCallback,
5    const FOnError & ErrorCallback
6)

Redeems the coupon code and delivers a reward to the user.

Parameters:

  • AuthToken User authorization token obtained during authorization using Xsolla Login (more about authorization options ).
  • CouponCode Unique case sensitive code. Contains letters and numbers.
  • SuccessCallback Called after successful coupon redemption.
  • ErrorCallback Called after the request resulted with an error.

The reward is delivered in one of the following ways:

  • to their inventory (virtual items, virtual currency packages, or bundles)
  • via email (game keys)
  • to the entitlement system (game keys) More about the use cases .

function IsItemInInventory

Copy
Full screen
Small screen
1static bool IsItemInInventory(
2    const FInventoryItemsData & Inventory,
3    const FString & ItemSKU,
4    FInventoryItem & FoundItem
5)

Checks if the certain item is in the inventory.

Protected Functions Documentation

function GetInventory_HttpRequestComplete

Copy
Full screen
Small screen
1void GetInventory_HttpRequestComplete(
2    FHttpRequestPtr HttpRequest,
3    FHttpResponsePtr HttpResponse,
4    const bool bSucceeded,
5    FOnInventoryUpdate SuccessCallback,
6    FErrorHandlersWrapper ErrorHandlersWrapper
7)

function GetVirtualCurrencyBalance_HttpRequestComplete

Copy
Full screen
Small screen
1void GetVirtualCurrencyBalance_HttpRequestComplete(
2    FHttpRequestPtr HttpRequest,
3    FHttpResponsePtr HttpResponse,
4    const bool bSucceeded,
5    FOnCurrencyBalanceUpdate SuccessCallback,
6    FErrorHandlersWrapper ErrorHandlersWrapper
7)

function GetTimeLimitedItems_HttpRequestComplete

Copy
Full screen
Small screen
1void GetTimeLimitedItems_HttpRequestComplete(
2    FHttpRequestPtr HttpRequest,
3    FHttpResponsePtr HttpResponse,
4    const bool bSucceeded,
5    FOnTimeLimitedItemsUpdate SuccessCallback,
6    FErrorHandlersWrapper ErrorHandlersWrapper
7)

function ConsumeInventoryItem_HttpRequestComplete

Copy
Full screen
Small screen
1void ConsumeInventoryItem_HttpRequestComplete(
2    FHttpRequestPtr HttpRequest,
3    FHttpResponsePtr HttpResponse,
4    const bool bSucceeded,
5    FOnInventoryRequestSuccess SuccessCallback,
6    FErrorHandlersWrapper ErrorHandlersWrapper
7)

function UpdateCouponRewards_HttpRequestComplete

Copy
Full screen
Small screen
1void UpdateCouponRewards_HttpRequestComplete(
2    FHttpRequestPtr HttpRequest,
3    FHttpResponsePtr HttpResponse,
4    const bool bSucceeded,
5    FOnCouponRewardsUpdate SuccessCallback,
6    FErrorHandlersWrapper ErrorHandlersWrapper
7)

function RedeemCoupon_HttpRequestComplete

Copy
Full screen
Small screen
1void RedeemCoupon_HttpRequestComplete(
2    FHttpRequestPtr HttpRequest,
3    FHttpResponsePtr HttpResponse,
4    const bool bSucceeded,
5    FOnCouponRedeemUpdate SuccessCallback,
6    FErrorHandlersWrapper ErrorHandlersWrapper
7)

Protected Attributes Documentation

variable ProjectID

FString ProjectID;

Cached Xsolla Store project id.

Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Last updated: October 27, 2026

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!
We couldn't send your feedback
Try again later or contact us at [email protected].