CommerceService
CommerceService is a service that supports real-world purchases that you can bundle with virtual items. For information on eligibility and implementation, see Commerce products.
Summary
Methods
Prompts a user to purchase a commerce product using the provided commerceProductId. Opens a webview that guides the user through the purchasing flow.
Retrieves information about the commerce products you are selling in experience.
Events
Fires when commerce purchase webview has closed - not an indicator that a purchase was successful.
Properties
Methods
PromptCommerceProductPurchase
Prompts a user to purchase a commerce product using the provided commerceProductId. Opens a webview that guides the user through the purchasing flow.
Parameters
Returns
PromptRealWorldCommerceBrowser
This is a legacy endpoint that is not meant for use. To open the webview to the purchasing flow for real world commerce, see CommerceService:PromptCommerceProductPurchase(). For more information, see Commerce products
Parameters
Returns
GetCommerceProductInfoAsync
Retrieves information about the products that you are selling and surface them within your experience. How you surface products to your users is entirely up to you.
Name | string | Localized name of of the physical item |
---|---|---|
Description | string | Localized description of the physical item |
IconImageAssetId | number | The image asset id of main default image of the physical item |
DisplayPrice | string | Localized price string with currency symbol of the physical item. e.g. “$4.99“ |
IsPurchasable | bool | If the item can be added to a merchant checkout session, i.e. item is in stock, or can be backordered |
Parameters
Returns
UserEligibleForRealWorldCommerceAsync
This is a legacy endpoint that is not meant for use. To check if a user is eligible for real world commerce, see PolicyService.IsEligibleToPurchaseCommerceProduct. For more information, see Commerce products
Returns
Events
PromptCommerceProductPurchaseFinished
Use this signal to detect when a user has completed the purchasing flow and the webview has closed to resume gameplay within the experience. This signal does not indicate a successful purchase, so do not grant virtual items solely from this signal.
While optional, it is recommended to use this signal to reorient your users on Android, as the commerce purchasing flow will have forced them into portrait mode.