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
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
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()
657StyledPropertiesChanged()
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 developer product 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 learning to use DataStoreService, which is responsible for saving and loading all 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 based on the asset ID and the InfoType. If an item with the given ID does not exist, this method throws 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 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
AssetIdnumberThe asset ID if InfoType is 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
ProductIdnumberThe product ID if InfoType is Product.
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 a specific user contains an asset, based on the asset ID. This method throws an error if the query fails, so you should 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 user buys 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 a specific user contains a bundle, based on the bundle ID. This method throws an error if the query fails, so you should 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

IMPORTANT: We highly recommend that you properly implement the ProcessReceipt callback in order to sell your developer products. You should use ProcessReceipt to grant users their purchased product over any other granting method. If your ProcessReceipt implementation isn't correct, you will not be able to grant users the products they have purchased on the Experience Detail page.

A callback to process receipts from developer product purchases. You can sell developer products inside an experience using MarketplaceService functions, or outside an experience on the Experience Detail page.

You should only set the ProcessReceipt callback one time in a single server-side Script. This callback must handle the receipts for all developer products you have for sale.

Guarantees

The ProcessReceipt callback is called for all unresolved developer product purchases when:

  • A user successfully completes the purchase of a developer product.
  • A successful developer product purchase prompt appears to the user.
  • A user joins the server.

A purchase is considered successfully initiated when:

  • The purchase is processed on Roblox's backend.
  • The funds are placed in escrow.

A purchase is considered resolved when:

Unresolved developer product purchases

An unresolved developer product purchase takes place when a user's purchase of a developer product has not yet been acknowledged by the server through the ProcessReceipt function.

Unresolved developer product purchases are not removed or refunded after the escrow period expires.

Retries and timeouts

ProcessReceipt has no time-based retry mechanism. If a user makes a purchase that returns a ProductPurchaseDecision enum of NotProcessedYet, the ProcessReceipt callback is only called again on the same server if:

  • The user successfully initiates another developer product purchase.
  • The user re-joins any server under the same experience.

ProcessReceipt also has no timeout for yielded callbacks. A ProcessReceipt callback can yield for as long as the server is running, and the callback result is still accepted when the result returns.

Limitations

  • When there are multiple purchases pending for a user, ProcessReceipt callbacks are called in a non-deterministic order.
  • The user must be on the server for the ProcessReceipt callback to be invoked.
  • The user does not have to be on the server for the result of the ProcessReceipt callback to be recorded on the backend.
  • The ProcessReceipt callback for a specific purchase might run on two different servers at the same time if the user joins the second server before the callback returns on the first server.
  • The ProcessReceipt callback might still fail to be recorded on the backend, even if it returns a ProductPurchaseDecision enum of PurchaseGranted. When this happens, the purchase remains unresolved.

History 3

PromptBulkPurchase

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

Prompts a user to purchase multiple avatar items with the given assetId or bundleId. Does not work with non-avatar items.

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

This event fires when a purchase prompt for a bulk avatar items closes. For example, when a user receives the purchase prompt and clicks Cancel, or when they receive a success or error message and click OK.

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

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 prompt for a pass closes. For example, when a user receives the purchase prompt and clicks Cancel, or when they receive a success or error message and click OK.

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 Premium and about incorporating Premium incentives into your experience, see Engagement-based payouts.

See also

History 3

PromptPremiumPurchaseFinished

Parameters (0)
No parameters.

This event fires when a purchase prompt for Roblox Premium closes. For example, when a user receives the purchase prompt and clicks Cancel, or when they receive a success or error message and click OK.

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

IMPORTANT: Do not use the PromptProductPurchaseFinished event to process purchases; instead, use the ProcessReceipt callback. The firing of PromptProductPurchaseFinished does not mean that a user has successfully purchased an item.

This event fires when a purchase prompt for a developer product closes. For example, when a user receives the purchase prompt and clicks Cancel, or when they receive a success or error message and click OK. The firing of this event does not mean that a user has successfully purchased an item.

While you can use the PromptProductPurchaseFinished event to detect when a user closes a purchase prompt, you should not use it to process purchases because those purchases might still fail in the backend for several reasons. For example, if a Roblox system is offline, or if the product price has changed and the user now doesn't have enough Robux to make the purchase. To process purchases, you must use ProcessReceipt. Using ProcessReceipt allows you to confirm that the purchase has succeeded before you grant the user the item they have purchased.

The PromptProductPurchaseFinished event fires with a Player.UserId instead of a reference to the Player object.

See also

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:

  • (Recommended) Server requests prompt original copies until they run out, regardless of the price. Once original copies run 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

This event fires when a purchase prompt for an affiliate gear sale or other asset closes. For example, when a user receives the purchase prompt and clicks Cancel, or when they receive a success or error message and click OK.

This event 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 a purchase prompt for an affiliate gear sale or other asset closes. For example, when a user receives the purchase prompt and clicks Cancel, or when they receive a success or error message and click OK.

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 user with the given UserId owns the pass with the given gamePassId (not to be confused with an asset ID).

Caching Behavior

The results of this function are remembered so that repeated calls are returned faster.

This function always returns true when the user first enters a server after purchasing the pass.

If the user has purchased the pass inside an experience through PromptGamePassPurchase, the UserOwnsGamePassAsync function might return false because of caching behavior. Alternatively, the function might return true even after the user has deleted the pass from their inventory.

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