Skip to content

Service · inherits Instance

CommerceService

Official docs ↗

Supports real-world purchases that you can bundle with digital benefits.

About 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.

Methods 4

  • GetCommerceProductInfoAsync(commerceProductId: string) → DictionaryYieldsRetrieves information about the commerce products you are selling in experience.

    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.

  • PromptCommerceProductPurchase(user: Player, commerceProductId: string) → ()Prompts a user to purchase a commerce product using the provided commerceProductId. Opens a webview that guides the user through the purchasing flow.
  • PromptRealWorldCommerceBrowser(player: Player, url: string) → ()Legacy endpoint that opens an in-experience browser to a real-world commerce URL for the specified player; superseded by CommerceService.PromptCommerceProductPurchase.

    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

  • UserEligibleForRealWorldCommerceAsync() → booleanYieldsLegacy endpoint that returns whether the current user is eligible for real-world commerce; superseded by PolicyService.

    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

Events 1

  • PromptCommerceProductPurchaseFinishedCommerceService.PromptCommerceProductPurchaseFinished:Connect(function(user, productId))Fires when commerce purchase webview has closed - not an indicator that a purchase was successful.

    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.

CommerceService also has every member of Instance. Deprecated and Roblox-only members are hidden.

Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.