Skip to content
Roblox API Reference

CommerceService

Supports real-world purchases that you can bundle with digital benefits.
  • Not creatable
  • Service
Memory category
Instances
Own members
12
Inherited members
75
Subclasses
0
Siblings
608

Properties23

Inherited fromObject2

Property categoryData

Inherited fromInstance21

Property categoryBehavior

Property categoryData

Property categoryPermissions

Methods48

Inherited fromObject3
  • Get an event that fires when a given property of the object changes.
    Parameters
    ParameterDescription
    property: string
    The property to connect to.
    Returns
    TypeDescription
    RBXScriptSignal
    A signal that fires whenever the property changes.
  • Object:IsA(className: string): boolean
    Returns true if an object's class matches or inherits from a given class.
    • Custom Lua state
    • Thread safe
    Parameters
    ParameterDescription
    className: string
    The class against which the Object's class will be checked. Case-sensitive.
    Returns
    TypeDescription
    boolean
    Describes whether the Object's class matched or is a subclass of the given class.
  • Object:isA(className: string): boolean
    Deprecated: This deprecated function is a variant of Object:IsA() which should be used instead.
    • Deprecated
    • Custom Lua state
    Parameters
    Parameter
    className: string
    Returns
    Type
    boolean

    Use IsA instead.

Inherited fromInstance39
Defined byCommerceService6
  • CommerceService:GetCommerceProductInfoAsync(commerceProductId: string): { [string]: any }
    Retrieves information about the commerce products you are selling in experience.
    • Yields
    • Capabilities: Monetization
    Parameters
    ParameterDescription
    commerceProductId: string
    The identifier of the commerce product to look up, either the numeric ID or the full COM--prefixed form.
    Returns
    TypeDescription
    { [string]: any }
    A dictionary of information about the commerce product, including whether it IsForSale, an Item sub-table of display details (Name, Description, IconImageAssetId, DisplayPrice, and IsPurchasable), and the Benefits granted by purchasing it.
  • CommerceService:PrepareCommerceProductPurchase(commerceProductId: string): { [string]: any }
    • Yields
    • Roblox script security
    • Capabilities: Monetization
    Parameters
    Parameter
    commerceProductId: string
  • CommerceService: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.
    • Capabilities: Monetization
    Parameters
    ParameterDescription
    user: Player
    The Player to prompt with the purchase flow. When called from a client script, this must be the local player.
    commerceProductId: string
    The identifier of the commerce product to purchase, either the numeric ID or the full COM--prefixed form.
  • CommerceService: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().
    • Capabilities: Monetization
    Parameters
    ParameterDescription
    player: Player
    The Player for whom the browser opens. When called from a client script, this must be the local player.
    url: string
    The real-world commerce URL to open. The URL must be on the commerce allowlist, or the request is ignored.
  • CommerceService:SignalPromptCommerceProductPurchaseFinished(productId: string,didTryPurchase: boolean,checkoutSessionId: string? = "",)
    • Roblox script security
    • Capabilities: Monetization
    Parameters
    Parameter
    productId: string
    didTryPurchase: boolean
    checkoutSessionId: string? = ""
  • CommerceService:UserEligibleForRealWorldCommerceAsync(): boolean
    Legacy endpoint that returns whether the current user is eligible for real-world commerce; superseded by PolicyService.
    • Yields
    • Capabilities: Monetization
    Returns
    TypeDescription
    boolean
    true if the current user is eligible for real-world commerce.

Events16

Inherited fromObject1
Inherited fromInstance9
Defined byCommerceService6
  • CommerceService.BenefitStatusReceived: RBXScriptSignal<(isGranted: boolean)>
    • Roblox script security
    • Capabilities: Monetization
    Parameters
    Parameter
    isGranted: boolean
  • CommerceService.FetchReceipt: RBXScriptSignal<()>
    • Roblox engine security
    • Capabilities: Monetization
  • CommerceService.InExperienceBrowserRequested: RBXScriptSignal<(url: string)>
    • Roblox engine security
    • Capabilities: Monetization
    Parameters
    Parameter
    url: string
  • CommerceService.PromptCommerceProductPurchaseFinished: RBXScriptSignal<(user: Player,productId: string,)>
    Fires when commerce purchase webview has closed - not an indicator that a purchase was successful.
    • Capabilities: Monetization
    Parameters
    Parameter
    user: Player
    productId: string
  • CommerceService.PromptCommerceProductPurchaseRequested: RBXScriptSignal<(commerceProductId: string)>
    • Roblox script security
    • Capabilities: Monetization
    Parameters
    Parameter
    commerceProductId: string
  • CommerceService.PurchaseBrowserClosed: RBXScriptSignal<()>
    • Roblox script security
    • Capabilities: Monetization