GetProductInfo
This is a yielding function. When called, it will pause the Lua thread that called the function until a result is ready to be returned, without interrupting other scripts.
This function provides information about an asset, developer product or game pass given its assetId and the Enum/InfoType
(Asset, Product or GamePass respectively).
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 object you are querying.
Name | Type | Description |
---|---|---|
Name | string | The name shown on the asset's page |
Description | string | The description as shown on the asset's page; can be nil if blank |
PriceInRobux | number | The cost of purchasing the asset using Robux |
Created | timestamp | Timestamp of when the asset was created, e.g. 2018-08-01T17:55:11.98Z |
Updated | timestamp | Timestamp of when the asset was last updated by its creator, e.g. 2018-08-01T17:55:11.98Z |
ContentRatingTypeId | number | Indicates whether the item is marked as 13+ in catalog |
MinimumMembershipLevel | number | The minimum subscription level necessary to purchase the item |
IsPublicDomain | boolean | Describes whether the asset can be taken for free |
Creator Information | ||
Creator | Dictionary | A table of information describing the creator of the asset (see following lines) |
Creator.CreatorType | string | Either User or Group |
Creator.CreatorTargetId | number | The ID of the creator user or group |
Creator.Name | string | The name/username of the creator |
Creator.Id | number | (Use CreatorTargetId instead) |
Assets | ||
AssetId | number | If InfoType was Asset, this is the ID of the given asset. |
AssetTypeId | number | The type of asset (e.g. place, model, shirt)* |
IsForSale | boolean | Describes whether the asset is purchasable |
IsLimited | boolean | Describes whether the asset is a "limited item" that is no longer (if ever) sold |
IsLimitedUnique | boolean | Describes whether the asset is a "limited unique" ("Limited U") item that only has a fixed number sold |
IsNew | boolean | Describes whether the asset is marked as "new" in the catalog |
Remaining | number | The remaining number of items a limited unique item may be sold |
Sales | number | The number of items the asset has been sold |
Developer Products and Game Passes | ||
ProductId | number | If the InfoType was Product, this is the product ID |
IconImageAssetId | number | This is the asset ID of the product/pass icon, or 0 if there isn't one |
* See articles/Asset types|Asset Types
for the asset type ID numbers.
†Timestamps are formatted using ISO 8601
Possible Errors
If no such item exists with the given ID, this function will throw an error:
- For developer products, the error is:
MarketplaceService:getProductInfo() failed because rawProductInfo was empty
- For game passes and assets, the error is:
MarketplaceService:getProductInfo() failed because HTTP 0 (HTTP 400 (HTTP/1.1 400 BadRequest))
See also
- Monetization Guides, learning materials related to monetizing your game
Parameters
Name | Type | Default | Description |
---|---|---|---|
|
The assetId of the specified product |
||
Asset
|
An |
Returns
Return Type | Summary |
---|---|
A dictionary containing information about the queried item (described in the table above). Note that not all information is provided or necessarily relevant for the kind of object you are querying |
Code Samples
Getting Product Info
The below example will print the name and description of the asset with an ID of 125378389. In this case it will print: “Mr. Fancy Top Hat :: So fancy that even his top hat’s top hat has a top hat.”