Reference API Roblox

Engine API

Website

Related

Reference API Roblox

MarketplaceService

The service responsible for in-experience transactions.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service]

Member index 85

HistoryMember
462GetDeveloperProductsAsync(): Instance
640GetDeveloperProductsForExperienceDetailsPageAsync(): Instance
462GetProductInfo(assetId: int64, infoType: InfoType = Asset): Dictionary
462GetRobuxBalance(): int
593GetSubscriptionProductInfoAsync(subscriptionId: string): Dictionary
589GetSubscriptionPurchaseInfoAsync(subscriptionId: string): Dictionary
614GetUserSubscriptionDetailsAsync(user: Player, subscriptionId: string): Dictionary
636GetUserSubscriptionDetailsInternalAsync(subscriptionId: string): Dictionary
593GetUserSubscriptionPaymentHistoryAsync(user: Player, subscriptionId: string): Array
593GetUserSubscriptionStatusAsync(user: Player, subscriptionId: string): Dictionary
625PerformBulkPurchase(orderRequest: Dictionary, options: Dictionary): Dictionary
639PerformCancelSubscription(subscriptionId: string): null
580PerformPurchase(infoType: InfoType, productId: int64, expectedPrice: int, requestId: string, isRobloxPurchase: bool, collectibleItemId: string = , collectibleProductId: string = , idempotencyKey: string = , purchaseAuthToken: string = ): Dictionary
587PerformPurchaseV2(infoType: InfoType, productId: int64, expectedPrice: int, requestId: string, isRobloxPurchase: bool, collectiblesProductDetails: Dictionary): Dictionary
597PerformSubscriptionPurchase(subscriptionId: string): string
618PerformSubscriptionPurchaseV2(subscriptionId: string, paymentProvider: string): null
462PlayerCanMakePurchases(player: Instance): bool
462PlayerOwnsAsset(player: Instance, assetId: int64): bool
529PlayerOwnsBundle(player: Player, bundleId: int64): bool
588PrepareCollectiblesPurchase(player: Instance, assetId: int64, collectibleItemId: string, collectibleItemInstanceId: string, collectibleProductId: string, expectedPrice: int): null
625PromptBulkPurchase(player: Player, lineItems: Array, options: Dictionary): null
573PromptBundlePurchase(player: Instance, bundleId: int64): null
636PromptCancelSubscription(user: Player, subscriptionId: string): null
588PromptCollectiblesPurchase(player: Instance, assetId: int64, collectibleItemId: string, collectibleItemInstanceId: string, collectibleProductId: string, expectedPrice: int): null
573PromptGamePassPurchase(player: Instance, gamePassId: int64): null
573PromptNativePurchase(player: Instance, productId: string): null
573PromptNativePurchaseWithLocalPlayer(productId: string): null
573PromptPremiumPurchase(player: Instance): null
573PromptProductPurchase(player: Instance, productId: int64, equipIfPurchased: bool = true, currencyType: CurrencyType = Default): null
573PromptPurchase(player: Instance, assetId: int64, equipIfPurchased: bool = true, currencyType: CurrencyType = Default): null
573PromptRobloxPurchase(assetId: int64, equipIfPurchased: bool): null
590PromptSubscriptionPurchase(user: Player, subscriptionId: string): null
573PromptThirdPartyPurchase(player: Instance, productId: string): null
573ReportAssetSale(assetId: string, robuxAmount: int): null
573ReportRobuxUpsellStarted(): null
573SignalAssetTypePurchased(player: Instance, assetType: AssetType): null
573SignalClientPurchaseSuccess(ticket: string, playerId: int64, productId: int64): null
573SignalMockPurchasePremium(): null
625SignalPromptBulkPurchaseFinished(status: MarketplaceBulkPurchasePromptStatus, results: Dictionary): null
573SignalPromptBundlePurchaseFinished(player: Instance, bundleId: int64, success: bool): null
573SignalPromptGamePassPurchaseFinished(player: Instance, gamePassId: int64, success: bool): null
573SignalPromptPremiumPurchaseFinished(didTryPurchasing: bool): null
573SignalPromptProductPurchaseFinished(userId: int64, productId: int64, success: bool): null
573SignalPromptPurchaseFinished(player: Instance, assetId: int64, success: bool): null
592SignalPromptSubscriptionPurchaseFinished(subscriptionId: string, didTryPurchasing: bool): null
573SignalServerLuaDialogClosed(value: bool): null
639SignalUserSubscriptionStatusChanged(subscriptionId: string): null
462UserOwnsGamePassAsync(userId: int64, gamePassId: int64): bool
462ClientLuaDialogRequested(arguments: Tuple)
462ClientPurchaseSuccess(ticket: string, playerId: int64, productId: int64)
462NativePurchaseFinished(player: Instance, productId: string, wasPurchased: bool)
546NativePurchaseFinishedWithLocalPlayer(productId: string, wasPurchased: bool)
588PrepareCollectiblesPurchaseRequested(player: Instance, assetId: int64, collectibleItemId: string, collectibleItemInstanceId: string, collectibleProductId: string, expectedPrice: int)
625PromptBulkPurchaseFinished(player: Instance, status: MarketplaceBulkPurchasePromptStatus, results: Dictionary)
625PromptBulkPurchaseRequested(player: Instance, displayData: Array, orderRequest: Dictionary, purchaserRobuxBalance: int64, orderTotalRobux: int64, options: Dictionary)
462PromptBundlePurchaseFinished(player: Instance, bundleId: int64, wasPurchased: bool)
462PromptBundlePurchaseRequested(player: Instance, bundleId: int64)
636PromptCancelSubscriptionRequested(subscriptionId: string)
618PromptCollectibleBundlePurchaseRequested(player: Instance, bundleId: int64, collectibleItemId: string, collectibleItemInstanceId: string, collectibleProductId: string, expectedPrice: int, idempotencyKey: string, purchaseAuthToken: string)
588PromptCollectiblesPurchaseRequested(player: Instance, assetId: int64, collectibleItemId: string, collectibleItemInstanceId: string, collectibleProductId: string, expectedPrice: int, idempotencyKey: string, purchaseAuthToken: string)
462PromptGamePassPurchaseFinished(player: Instance, gamePassId: int64, wasPurchased: bool)
462PromptGamePassPurchaseRequested(player: Instance, gamePassId: int64)
462PromptPremiumPurchaseFinished()
462PromptPremiumPurchaseRequested(player: Instance)
557PromptProductPurchaseFinished(userId: int64, productId: int64, isPurchased: bool)
462PromptProductPurchaseRequested(player: Instance, productId: int64, equipIfPurchased: bool, currencyType: CurrencyType)
462PromptPurchaseFinished(player: Instance, assetId: int64, isPurchased: bool)
462PromptPurchaseRequested(player: Instance, assetId: int64, equipIfPurchased: bool, currencyType: CurrencyType)
580PromptPurchaseRequestedV2(player: Instance, assetId: int64, equipIfPurchased: bool, currencyType: CurrencyType, idempotencyKey: string, purchaseAuthToken: string)
462PromptRobloxPurchaseRequested(assetId: int64, equipIfPurchased: bool)
592PromptSubscriptionPurchaseFinished(user: Player, subscriptionId: string, didTryPurchasing: bool)
590PromptSubscriptionPurchaseRequested(subscriptionId: string)
462ServerPurchaseVerification(serverResponseTable: Dictionary)
462ThirdPartyPurchaseFinished(player: Instance, productId: string, receipt: string, wasPurchased: bool)
639UserSubscriptionStatusChanged(subscriptionId: string)
462ProcessReceipt(receiptInfo: Dictionary): ProductPurchaseDecision
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 10

HistoryMember
396GetSubscriptionStatus(player: Instance, subscriptionId: int64): Dictionary
589IsPlayerSubscribed(player: Instance, subscriptionId: int64): bool
589PromptSubscriptionCancellation(player: Instance, subscriptionId: int64): null
158SetDevProductInfoUrl(url: string): void
158SetPlayerOwnsAssetUrl(url: string): void
158SetProductInfoUrl(url: string): void
589SignalPromptSubscriptionCancellationFinished(player: Instance, subscriptionId: int64, wasCanceled: bool): null
589PromptSubscriptionCancellationFinished(player: Instance, subscriptionId: int64, wasCanceled: bool)
589PromptSubscriptionCancellationRequested(player: Instance, subscriptionId: int64)

Description

MarketplaceService is responsible for in-experience transactions. The most notable methods are PromptProductPurchase and PromptPurchase, as well as the callback ProcessReceipt which must be defined so that transactions do not fail.

MarketplaceService also has methods that fetch information about developer products (GetProductInfo and GetDeveloperProductsAsync), passes (UserOwnsGamePassAsync), and other assets (PlayerOwnsAsset, PlayerOwnsBundle).

Understanding MarketplaceService is the first step towards learning to monetize an experience on Roblox, as well as DataStoreService which is responsible for saving and loading data related to purchases.

History 242

Members 85

ClientLuaDialogRequested

Parameters (1)
argumentsTuple

History 2

ClientPurchaseSuccess

Parameters (3)
ticketstring
playerIdint64
productIdint64

History 3

GetDeveloperProductsAsync

Parameters (0)
No parameters.
Returns (1)
Instance

Returns a Pages object which contains information for all of the current experience's developer products.

This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

GetDeveloperProductsForExperienceDetailsPageAsync

Parameters (0)
No parameters.
Returns (1)
Instance
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetProductInfo

Parameters (2)Default
assetIdint64
infoTypeInfoTypeAsset
Returns (1)
Dictionary

This method provides information about an asset, developer product, or pass given its asset ID and the InfoType. If no such item exists with the given ID, this method will throw an error. Information about the queried item is provided in a dictionary with the following keys. Note that not all information is provided or necessarily relevant for the kind of product you're querying.

KeyTypeDescription
NamestringThe name shown on the asset's page.
DescriptionstringThe description as shown on the asset's page; can be nil if blank.
PriceInRobuxnumberThe cost of purchasing the asset using Robux.
CreatedstringTimestamp of when the asset was created, for example 2022-01-02T10:30:45Z. Formatted using ISO 8601.
UpdatedstringTimestamp of when the asset was last updated by its creator, for example 2022-02-12T11:22:15Z. Formatted using ISO 8601.
ContentRatingTypeIdnumberIndicates whether the item is marked as 13+ in catalog.
MinimumMembershipLevelnumberThe minimum subscription level necessary to purchase the item.
IsPublicDomainbooleanDescribes whether the asset can be taken for free.

Creator Information

KeyTypeDescription
CreatortableDictionary table of information describing the creator of the asset (see following lines).
Creator.CreatorTypestringEither User or Group.
Creator.CreatorTargetIdnumberThe ID of the creator user or group.
Creator.HasVerifiedBadgebooleanWhether the creator has a verified badge.
Creator.NamestringThe name/username of the creator.
Creator.IdnumberUse Creator.CreatorTargetId instead.

Asset Information

KeyTypeDescription
AssetIdnumberIf InfoType was Asset, the ID of the given asset.
AssetTypeIdnumberThe type of asset. See AssetType for the asset type ID numbers.
IsForSalebooleanDescribes whether the asset is purchasable.
IsLimitedbooleanDescribes whether the asset is a Roblox Limited that is no longer (if ever) sold.
IsLimitedUniquebooleanDescribes whether the asset is a unique Roblox Limited ("Limited U") item that only has a fixed number sold.
IsNewbooleanDescribes whether the asset is marked as "new" in the catalog.
RemainingnumberThe remaining number of items a limited unique item may be sold.
SalesnumberThe number of items the asset has been sold.
SaleAvailabilityLocationstableThe item's ProductLocationRestriction or sale location setting.
CanBeSoldInThisGamebooleanDescribes whether the asset is purchasable in the current experience.

Developer Products and Passes

KeyTypeDescription
ProductIdnumberIf InfoType was Product, the product ID.
IconImageAssetIdnumberThe asset ID of the product/pass icon, or 0 if there isn't one.
This function yields. It will block the calling thread until completion.

History 5

Tags: [Yields]

GetRobuxBalance

Parameters (0)
No parameters.
Returns (1)
int
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

GetSubscriptionProductInfoAsync

Parameters (1)
subscriptionIdstring
Returns (1)
Dictionary

Note: Because it returns a localized price, you can only call this method from a Script with RunContext.Client.

Returns the product information of a subscription for the given subscriptionId.

KeyTypeDescription
NamestringThe name of the subscription product.
DescriptionstringThe description of the subscription product.
IconImageAssetIdnumberThe asset ID of the subscription product icon.
SubscriptionPeriodSubscriptionPeriodThe duration of the subscription (for example, Month, Year, etc.).
DisplayPricestringLocalized price with the appropriate currency symbol for display (for example, $4.99). For users in unsupported countries, DisplayPrice returns a string without specific price information.
DisplaySubscriptionPeriodstringLocalized subscription period text for display (for example, /month). Can be used together with DisplayPrice.
SubscriptionProviderNamestringName of the subscription benefit provider (for example, the name of the associated experience).
IsForSalebooleanTrue if the subscription product is available for sale.
PriceTiernumberA number that can be used to compare the price of different subscription products. This is not the actual price of the subscription (for example, 499).
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetSubscriptionPurchaseInfoAsync

Parameters (1)
subscriptionIdstring
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetUserSubscriptionDetailsAsync

Parameters (2)
userPlayer
subscriptionIdstring
Returns (1)
Dictionary

Returns a dictionary table containing the details of the user's subscription for the given subscriptionId. The table contains the following keys:

KeyTypeDescription
SubscriptionStateSubscriptionStateCurrent state of this particular subscription.
NextRenewTimeDateTimeRenewal time for this current subscription. May be in the past if the subscription is in SubscribedRenewalPaymentPending state. This field is will be nil if the subscription will not renew, is Expired, or the user never subscribed.
ExpireTimeDateTimeWhen this subscription expires. This field will be nil if the subscription is not cancelled or the user never subscribed.
ExpirationDetailstableTable containing the details of the subscription expiration. This field will be nil if the subscription is not in the Expired state. If populated, the table contains a ExpirationReason key of type SubscriptionExpirationReason describing why the subscription is expired.

Note that this method can only be called from a Script with RunContext of Server. If you only need to determine the IsSubscribed status of a user, it's recommended to use GetUserSubscriptionStatusAsync() as it is faster and more efficient for that particular purpose.

This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetUserSubscriptionDetailsInternalAsync

Parameters (1)
subscriptionIdstring
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetUserSubscriptionPaymentHistoryAsync

Parameters (2)
userPlayer
subscriptionIdstring
Returns (1)
Array

Note: You can only call this method from a Script with RunContext.Server.

Returns an Array that contains up to one year of the user's subscription payment history for the given subscriptionId, sorted from the most recent status to the least recent.

Each entry in the payment history Array contains the following keys:

KeyTypeDescription
CycleStartTimeDateTimeDateTime at the start of this particular subscription period.
CycleEndTimeDateTimeDateTime at the end of this particular subscription period.
PaymentStatusSubscriptionPaymentStatusSubscriptionPaymentStatus.Paid if the user paid for this particular subscription period. SubscriptionPaymentStatus.Refunded if the user refunded this particular subscription period.

Payment History Length

Only creators affiliated with the subscription product can access up to one year worth of the user's subscription payment history. Non-associated creators can only get the user's current subscription payment status or an empty Array if the user has no active subscription.

Grace Period

Subscription renewal payments can have some processing time. Payment history doesn't return a table for this period. However, in order to preserve a user's subscription experience during the processing period, GetUserSubscriptionStatusAsync() returns IsSubscribed: true for the given user. Don't grant durable items or currency type subscription benefits to the user until after payment has been confirmed for the current cycle.

For example, on August 31, 2023, User A's Subscription B is up for renewal. On September 1, 2023, the payment has yet to be processed. If you call GetUserSubscriptionPaymentHistoryAsync() on September 1, 2023 on User A for Subscription B, the first entry of the return value is:

KeyValue
CycleStartTime...
CycleEndTimeAugust 31, 2023
PaymentStatusSubscriptionPaymentStatus.Paid

Note that since the user is within the grace period, the cycle they have yet to pay for (September 1, 2023) does not appear in the return value at all. This field only populates after the payment has been received and processed.

At the same time, GetUserSubscriptionStatusAsync returns the following result until the renewal payment process fails or the user cancels:

KeyReturn
IsSubscribedTrue
IsRenewingTrue
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetUserSubscriptionStatusAsync

Parameters (2)
userPlayer
subscriptionIdstring
Returns (1)
Dictionary

Returns a table that contains the subscription status of the user for the given subscriptionId. The table contains the following keys:

KeyTypeDescription
IsSubscribedbooleanTrue if the user's subscription is active.
IsRenewingbooleanTrue if the user is set to renew this subscription after the current subscription period ends.

Note that IsSubscribed will be true only when a user has purchased the subscription and the payment has been successfully processed. If the payment for a user's initial subscription purchase is still processing or has failed, IsSubscribed returns false. To understand when a user's subscription status has changed, see the Players.UserSubscriptionStatusChanged event.

This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

NativePurchaseFinished

Parameters (3)
playerInstance
productIdstring
wasPurchasedbool

History 2

NativePurchaseFinishedWithLocalPlayer

Parameters (2)
productIdstring
wasPurchasedbool

History 1

PerformBulkPurchase

Parameters (2)
orderRequestDictionary
optionsDictionary
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

PerformCancelSubscription

Parameters (1)
subscriptionIdstring
Returns (1)
null
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

PerformPurchase

Parameters (9)Default
infoTypeInfoType
productIdint64
expectedPriceint
requestIdstring
isRobloxPurchasebool
collectibleItemIdstring
collectibleProductIdstring
idempotencyKeystring
purchaseAuthTokenstring
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 6

Tags: [Yields]

PerformPurchaseV2

Parameters (6)
infoTypeInfoType
productIdint64
expectedPriceint
requestIdstring
isRobloxPurchasebool
collectiblesProductDetailsDictionary
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

PerformSubscriptionPurchase

Parameters (1)
subscriptionIdstring
Returns (1)
string
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

PerformSubscriptionPurchaseV2

Parameters (2)
subscriptionIdstring
paymentProviderstring
Returns (1)
null
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

PlayerCanMakePurchases

Parameters (1)
playerInstance
Returns (1)
bool

History 2

PlayerOwnsAsset

Parameters (2)
playerInstance
assetIdint64
Returns (1)
bool

Returns whether the inventory of the given player contains an asset, given its ID. In the case that a query fails, this method will throw an error, so it's recommended to wrap calls to this method in pcall().

  • This method should not be used for passes since they use a separate ID system. Legacy passes that still depend on an asset ID should use UserOwnsGamePassAsync() instead of this method.
  • This method cannot be used to check for developer products since they can be purchased multiple times but not owned themselves. Instead, use a data store to save when a player has bought a developer product.
This function yields. It will block the calling thread until completion.

History 3

Tags: [Yields]

PlayerOwnsBundle

Parameters (2)
playerPlayer
bundleIdint64
Returns (1)
bool

Returns whether the inventory of given Player contains a bundle, given its ID. In the case that a query fails, this method will throw an error, so it's recommended to wrap calls to this method in pcall().

This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

PrepareCollectiblesPurchase

Parameters (6)
playerInstance
assetIdint64
collectibleItemIdstring
collectibleItemInstanceIdstring
collectibleProductIdstring
expectedPriceint
Returns (1)
null

History 2

PrepareCollectiblesPurchaseRequested

Parameters (6)
playerInstance
assetIdint64
collectibleItemIdstring
collectibleItemInstanceIdstring
collectibleProductIdstring
expectedPriceint

History 2

ProcessReceipt

Parameters (1)
receiptInfoDictionary
Returns (1)
ProductPurchaseDecision

A callback to process receipts of developer product purchases. This callback should be set once and only once by a single Script. If you're selling multiple products in your experience, this callback should handle receipts for all of them.

Guarantees

On any given server, the ProcessReceipt callback is called for all of a player's unresolved developer product purchases when:

  • The player successfully initiates a product purchase (same product or another product) on this server.
  • The player joins the server.

Once a developer product purchase is requested, it is considered "successfully initiated" when processed on Roblox's backend and once the funds have been placed in escrow. Subsequently, the purchase is considered "resolved" if a ProcessReceipt callback returns a ProductPurchaseDecision enum of PurchaseGranted and this is successfully recorded on the backend.

An exception to the above rules is when a callback for the given unresolved purchase has been called on the same server but has not yet returned (it has yielded and not returned). In this case, the callback will not be invoked.

Unresolved Purchases

Unresolved developer product purchases are not removed or refunded after the escrow period has expired. Instead, ProcessReceipt callbacks will indefinitely be invoked for unresolved purchases in the manner described above.

Retries / Timeout

There is no time-based "retry" mechanism, meaning that if a ProductPurchaseDecision enum of NotProcessedYet is returned for a purchase, it will not try again on the same server unless the player successfully initiates another developer product purchase (same product or another product) or re-joins the server. There is also no "timeout" for yielded callbacks; a callback can yield for as long as the server is running and its result will still be accepted when it does return.

Notes

  • Where there are multiple purchases pending for the player, ProcessReceipt callbacks are called in a non-deterministic order.

  • The player needs to be in the server for the callback to be invoked, but does not need to be in the server for the result of the callback to be recorded on the backend.

  • The callback for a given purchase may run on two different servers at the same time, if the player joins another server before the callback in the previous server returns.

  • Even if a ProductPurchaseDecision enum of PurchaseGranted is returned in the callback function, it's possible that it will fail to be recorded on the backend. In this case, the purchase will remain unresolved and ProcessReceipt will continue to be invoked in the manner described above.

History 3

PromptBulkPurchase

Parameters (3)
playerPlayer
lineItemsArray
optionsDictionary
Returns (1)
null

Prompts a user to purchase multiple avatar items with the given assetId/bundleIds. This does not work with non-Avatar items.

MarketplaceService.PromptBulkPurchase() only allows prompting from server scripts.

For limited items, original copies are prompted until they run out, regardless of the price. Once original copies are out, resale copies are prompted.

A maximum of 20 items can be added to a single bulk purchase prompt.

History 1

PromptBulkPurchaseFinished

Parameters (3)
playerInstance
statusMarketplaceBulkPurchasePromptStatus
resultsDictionary

Returns when a bulk purchase prompt for avatar items is closed. This fires right as the dialog closes, when the player presses "Cancel" at the prompt or "OK" at the success/error message.

Note: This is not a trusted event from the client. To check if the user owns the items purchased, MarketplaceService.PlayerOwnsAsset or MarketplaceService.PlayerOwnsBundle can be used.

History 1

PromptBulkPurchaseRequested

Parameters (6)
playerInstance
displayDataArray
orderRequestDictionary
purchaserRobuxBalanceint64
orderTotalRobuxint64
optionsDictionary

History 1

PromptBundlePurchase

Parameters (2)
playerInstance
bundleIdint64
Returns (1)
null

Prompts a user to purchase a bundle with the given bundleId.

History 4

PromptBundlePurchaseFinished

Parameters (3)
playerInstance
bundleIdint64
wasPurchasedbool

History 3

PromptBundlePurchaseRequested

Parameters (2)
playerInstance
bundleIdint64

History 2

PromptCancelSubscription

Parameters (2)
userPlayer
subscriptionIdstring
Returns (1)
null

Prompts a user to cancel a subscription for the given subscriptionId. Once the user successfully cancels the subscription, the Players.UserSubscriptionStatusChanged event fires.

History 1

PromptCancelSubscriptionRequested

Parameters (1)
subscriptionIdstring

History 1

PromptCollectibleBundlePurchaseRequested

Parameters (8)
playerInstance
bundleIdint64
collectibleItemIdstring
collectibleItemInstanceIdstring
collectibleProductIdstring
expectedPriceint
idempotencyKeystring
purchaseAuthTokenstring

History 1

PromptCollectiblesPurchase

Parameters (6)
playerInstance
assetIdint64
collectibleItemIdstring
collectibleItemInstanceIdstring
collectibleProductIdstring
expectedPriceint
Returns (1)
null

History 2

PromptCollectiblesPurchaseRequested

Parameters (8)
playerInstance
assetIdint64
collectibleItemIdstring
collectibleItemInstanceIdstring
collectibleProductIdstring
expectedPriceint
idempotencyKeystring
purchaseAuthTokenstring

History 2

PromptGamePassPurchase

Parameters (2)
playerInstance
gamePassIdint64
Returns (1)
null

Prompts a user to purchase a pass with the given gamePassId.

History 6

PromptGamePassPurchaseFinished

Parameters (3)
playerInstance
gamePassIdint64
wasPurchasedbool

This event fires when a purchase dialog for a pass is closed. It fires as the dialog closes, when the player presses "Cancel" at the prompt or "OK" at the success/error message.

For repeatable purchases use developer products.

See Also

History 5

PromptGamePassPurchaseRequested

Parameters (2)
playerInstance
gamePassIdint64

History 5

PromptNativePurchase

Parameters (2)
playerInstance
productIdstring
Returns (1)
null

History 3

PromptNativePurchaseWithLocalPlayer

Parameters (1)
productIdstring
Returns (1)
null

History 2

PromptPremiumPurchase

Parameters (1)
playerInstance
Returns (1)
null

Prompts a user to purchase Roblox Premium. To learn more about and incorporating Premium incentives into your experience, see Engagement-Based Payouts.

See Also

History 3

PromptPremiumPurchaseFinished

Parameters (0)
No parameters.

This event fires when the Roblox Premium purchase modal closes, specifically when the player presses "Cancel" at the prompt, "OK" at the error message, or after the payment UI closes.

See Also

History 2

PromptPremiumPurchaseRequested

Parameters (1)
playerInstance

History 2

PromptProductPurchase

Parameters (4)Default
playerInstance
productIdint64
equipIfPurchasedbooltrue
currencyTypeCurrencyTypeDefault
Returns (1)
null

Prompts a user to purchase a developer product with the given productId.

History 4

PromptProductPurchaseFinished

Parameters (3)
userIdint64
productIdint64
isPurchasedbool

Fires when a purchase prompt closes for a developer product, right as the dialog closes when the player presses "Cancel" at the prompt or "OK" at the success/error message. You can use this event to detect when a purchase prompt is closed, but it should not be used to process purchases; instead use MarketplaceService.ProcessReceipt.

Unlike the similarly-named events above, this event fires with a Player.UserId and not a reference to the Player object.

History 5

PromptProductPurchaseRequested

Parameters (4)
playerInstance
productIdint64
equipIfPurchasedbool
currencyTypeCurrencyType

History 3

PromptPurchase

Parameters (4)Default
playerInstance
assetIdint64
equipIfPurchasedbooltrue
currencyTypeCurrencyTypeDefault
Returns (1)
null

Prompts a user to purchase an item with the given assetId. This does not work for USD Creator Store purchases. If prompting a purchase of a Limited item:

  • Server requests (recommended) prompt original copies until they run out, regardless of the price. Once original copies are out, resale copies are prompted.

  • Client requests prompt from the lowest resale price even if original copies are available.

History 4

PromptPurchaseFinished

Parameters (3)
playerInstance
assetIdint64
isPurchasedbool

Fires when a purchase prompt for an affiliate gear sale or other asset is closed. This fires right as the dialog closes, when the player presses "Cancel" at the prompt or "OK" at the success/error message. Does not fire for developer product or pass prompts.

See Also

History 3

PromptPurchaseRequested

Parameters (4)
playerInstance
assetIdint64
equipIfPurchasedbool
currencyTypeCurrencyType

History 3

PromptPurchaseRequestedV2

Parameters (6)
playerInstance
assetIdint64
equipIfPurchasedbool
currencyTypeCurrencyType
idempotencyKeystring
purchaseAuthTokenstring

History 1

PromptRobloxPurchase

Parameters (2)
assetIdint64
equipIfPurchasedbool
Returns (1)
null

History 3

PromptRobloxPurchaseRequested

Parameters (2)
assetIdint64
equipIfPurchasedbool

History 2

PromptSubscriptionPurchase

Parameters (2)
userPlayer
subscriptionIdstring
Returns (1)
null

Prompts a user to purchase a subscription for the given subscriptionId.

History 6

PromptSubscriptionPurchaseFinished

Parameters (3)
userPlayer
subscriptionIdstring
didTryPurchasingbool

This event fires when the subscription purchase modal closes, specifically when the users presses Cancel, OK at the error message, or after the payment UI closes.

See Also

History 8

PromptSubscriptionPurchaseRequested

Parameters (1)
subscriptionIdstring

History 4

PromptThirdPartyPurchase

Parameters (2)
playerInstance
productIdstring
Returns (1)
null

History 4

ReportAssetSale

Parameters (2)
assetIdstring
robuxAmountint
Returns (1)
null

History 3

ReportRobuxUpsellStarted

Parameters (0)
No parameters.
Returns (1)
null

History 3

ServerPurchaseVerification

Parameters (1)
serverResponseTableDictionary

History 2

SignalAssetTypePurchased

Parameters (2)
playerInstance
assetTypeAssetType
Returns (1)
null

History 3

SignalClientPurchaseSuccess

Parameters (3)
ticketstring
playerIdint64
productIdint64
Returns (1)
null

History 4

SignalMockPurchasePremium

Parameters (0)
No parameters.
Returns (1)
null

History 3

SignalPromptBulkPurchaseFinished

Parameters (2)
statusMarketplaceBulkPurchasePromptStatus
resultsDictionary
Returns (1)
null

History 1

SignalPromptBundlePurchaseFinished

Parameters (3)
playerInstance
bundleIdint64
successbool
Returns (1)
null

History 3

SignalPromptGamePassPurchaseFinished

Parameters (3)
playerInstance
gamePassIdint64
successbool
Returns (1)
null

History 6

SignalPromptPremiumPurchaseFinished

Parameters (1)
didTryPurchasingbool
Returns (1)
null

History 3

SignalPromptProductPurchaseFinished

Parameters (3)
userIdint64
productIdint64
successbool
Returns (1)
null

History 4

SignalPromptPurchaseFinished

Parameters (3)
playerInstance
assetIdint64
successbool
Returns (1)
null

History 4

SignalPromptSubscriptionPurchaseFinished

Parameters (2)
subscriptionIdstring
didTryPurchasingbool
Returns (1)
null

History 6

SignalServerLuaDialogClosed

Parameters (1)
valuebool
Returns (1)
null

History 3

SignalUserSubscriptionStatusChanged

Parameters (1)
subscriptionIdstring
Returns (1)
null

History 1

ThirdPartyPurchaseFinished

Parameters (4)
playerInstance
productIdstring
receiptstring
wasPurchasedbool

History 3

UserOwnsGamePassAsync

Parameters (2)
userIdint64
gamePassIdint64
Returns (1)
bool

Returns true if the player with the given UserId owns the pass with the given gamePassId, not to be confused with an asset ID.

Caching Behavior

Results of this function are remembered so that repeated calls will return quicker. This function will always return true if the player owns the pass upon first entering a server after having purchased the pass. If the pass is purchased in-experience through PromptGamePassPurchase(), this function may return false due to the caching behavior. Conversely, if the player deletes the pass from their inventory, this function may return true despite the player not owning the pass.

This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

UserSubscriptionStatusChanged

Parameters (1)
subscriptionIdstring

History 1

Removed members 10

GetSubscriptionStatus

Parameters (2)
playerInstance
subscriptionIdint64
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

IsPlayerSubscribed

Parameters (2)
playerInstance
subscriptionIdint64
Returns (1)
bool
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.
This function yields. It will block the calling thread until completion.

History 4

Tags: [Yields, Deprecated]

PromptSubscriptionCancellation

Parameters (2)
playerInstance
subscriptionIdint64
Returns (1)
null
This function is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 5

Tags: [Deprecated]

PromptSubscriptionCancellationFinished

Parameters (3)
playerInstance
subscriptionIdint64
wasCanceledbool
This event is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 4

Tags: [Deprecated]

PromptSubscriptionCancellationRequested

Parameters (2)
playerInstance
subscriptionIdint64

History 3

SetDevProductInfoUrl

Parameters (1)
urlstring
Returns (1)
void

History 2

SetPlayerOwnsAssetUrl

Parameters (1)
urlstring
Returns (1)
void

History 3

SetProductInfoUrl

Parameters (1)
urlstring
Returns (1)
void

History 3

SignalPromptSubscriptionCancellationFinished

Parameters (3)
playerInstance
subscriptionIdint64
wasCanceledbool
Returns (1)
null

History 4

Settings