Step 2. Get the product list
Retrieve the product names, prices, currencies, and other information of the Steam products registered in the Hive Axyl server. Use this to show users the latest list of products currently available for sale and accurate prices.
Follow the steps below to retrieve Steam product information.
1. Get the Steam user ID (StorePlayerId)
To retrieve Steam payment products, you must first get the user's Steam 64-bit SteamID. This value is used as StorePlayerId in later steps.
Call SteamUser.GetSteamID() of Steamworks.NET to get the 64-bit SteamID of the currently logged-in Steam user.
You cannot get a valid SteamID if SteamAPI.Init() has not been called. Make sure that you meet the Steamworks initialization prerequisites described in Step 1. Set up the integration.
2. Get product details
Retrieve the details of the Steam products registered in the Hive Axyl server. Display the retrieved product information to users.
FetchSteamProductsAsync
To implement Steam product list retrieval, call FetchSteamProductsAsync() provided by the Hive Axyl SDK. This call internally performs Steam account linking verification, GetUserInfo, and block checks, and then returns the product list based on the user's currency in the service standard format (Single Standard). You do not need a separate call to retrieve purchasing user information.
Call parameters
| Field name | Type | Required | Description |
|---|---|---|---|
| request | ProductSteam | Required | Request data that contains the query conditions (product type, market, and so on). |
| context | ApiCallContext | Optional | Per-call settings object that specifies the idempotency key, cancellation token, and request policy. If omitted, the default values are used. |
ProductSteam
| Field name | Type | Required | Description |
|---|---|---|---|
AppVersion | string | Optional | Pass the app's current build version as a string. Example: 1.0.0 |
Language | string | Required | Language code (ISO 639-1 two-letter) to use for localizing product names and other text. Example: ko |
ProductType | string | Optional | Product type. Example: consumable |
ProviderId | ProductSteamProviderId (enum) | Required | Market identifier. Because this request is only for retrieving Steam products, specify only Steam. |
ServerId | string | Optional | Server ID that you check on the App Server tab after registering the app server in App Info > App Server by following Hive Console App Server. Example: server01 |
StorePlayerId | long | Required | Steam 64-bit SteamID. Steam uses it to determine the user's country and currency. |
Call example
Check the success result of PaymentsFetchSteamProductsResult and the domain-specific results (Outcome) defined by this method in the example below and in the response status. For the result model and handling principles of common failures (Failure) that prevent the request from being performed, see Common error handling.
using Hive.Axyl.Payments;
using Hive.Axyl.Core;
// payments: IPaymentsService registered during initialization (for how to retrieve it, see [Install and initialize the module](../init.md))
IPaymentsService payments = HiveCore.Resolve<IPaymentsService>();
// Create a request object that contains the query conditions.
var request = new ProductSteam
{
ProductType = "consumable",
ProviderId = ProductSteamProviderId.Steam,
Language = "ko",
StorePlayerId = storePlayerId
};
PaymentsFetchSteamProductsResult result = await payments.FetchSteamProductsAsync(request);
switch (result)
{
case PaymentsFetchSteamProductsResult.Success success:
// Build the in-app store screen with the product list refined into the standard format.
foreach (var product in success.Data.Products)
{
Debug.Log($"{product.ProductId}: {product.Title} ({product.DisplayPrice})");
}
break;
// Handle request validation failure results (Outcome)
case PaymentsFetchSteamProductsResult.PaymentBadRequest:
case PaymentsFetchSteamProductsResult.PaymentInvalidParameter:
// Check the request fields and required values.
break;
// Handle common Failure
case PaymentsFetchSteamProductsResult.Failure failure:
HiveError err = failure.Problem;
Debug.LogError($"[{err.Code}] {err.Message} (trace: {err.TraceId})");
break;
// Safety net: unhandled results and unknown new results (UnknownOutcome)
default:
Debug.LogWarning($"Unhandled result: {result.GetType().Name}");
break;
}
Response data
On success, the result is contained in Data (ProductResponseData) of PaymentsFetchSteamProductsResult.Success.
| Field name | Type | Required | Description |
|---|---|---|---|
Data.AppVersion | string | Optional | App version. |
Data.Country | string | Optional | Country information. |
Data.Currency | string | Optional | Currency. |
Data.Language | string | Required | Language. |
Data.Products | IReadOnlyList<ProductProducts> | Optional | List of product information refined into the standard format. |
Data.ProviderId | ProductProviderId (enum) | Required | Market identifier. This response returns Steam. |
Data.Meta | string | Optional | Response meta information. null if there is none. |
ProductProducts
| Field name | Type | Required | Description |
|---|---|---|---|
Currency | string | Optional | Currency. Example: KRW |
Description | string | Optional | Product description. |
DisplayOriginalPrice | string | Optional | Price before discount, for display. Example: ₩1,100 |
DisplayPrice | string | Optional | Price for display. Example: 1,200 KRW |
OriginalPrice | decimal | Optional | Price before discount. It may include decimals depending on the currency. Example: 1100 or 11.00 |
Price | decimal | Optional | Price. It may include decimals depending on the currency. Example: 1200 or 9.99 |
ProductId | string | Optional | Unique identifier (PID) of the product. |
ProductType | string | Optional | Product type. subscription (subscription), consumable (consumable) |
Title | string | Optional | Product title. Example: 1000 Gold |
Response example
// Example of success.Data in the Success branch
// success.Data.ProviderId = ProductProviderId.Steam
// success.Data.Currency = "KRW"
// success.Data.Products[0].ProductId = "com.game.product1"
// success.Data.Products[0].Title = "1000 Gold"
// success.Data.Products[0].Price = 1200.0
// success.Data.Products[0].DisplayPrice = "1,200 KRW"
// success.Data.Products[0].ProductType = "consumable"
Response status
The table below summarizes the success result of PaymentsFetchSteamProductsResult and the domain-specific results (Outcome) defined by this method. For the result model and handling principles of common failures (Failure) that prevent the request from being performed, see Common error handling.
| Response case | Description | App client handling |
|---|---|---|
Success | The product list was retrieved successfully. Data contains the product list in the standard format. | Build the in-app store screen with the product list |
PaymentBadRequest | The request cannot be processed. | Check the request values and call conditions |
PaymentInvalidParameter | Invalid parameter. | Check the request field values and retry |
UnknownOutcome | A domain-specific result that the SDK does not recognize. | Treat it as a failure and log the result code |
Failure | Common Failure. See Common error handling. | Handle it according to the common error handling guidelines |