Skip to main content

MarketplaceUtils

Provides utility methods for MarketplaceService

Types

CreatorProductInfo

interface CreatorProductInfo {
CreatorTypestring--

Either User or Group

CreatorTargetIdnumber--

The ID of the creator user or group

Namestring--

The name/username of the creator

Idnumber--

(Use CreatorTargetId instead)

}

Product info about the creator. See MarketplaceService.GetProductInfo.

AssetProductInfo

interface AssetProductInfo {
CreatorCreatorProductInfo--

A table of information describing the creator of the asset

AssetIdnumber--

If InfoType was Asset, this is the ID of the given asset.

AssetTypeIdnumber--

The type of asset (e.g. place, model, shirt)*

IsForSaleboolean--

Describes whether the asset is purchasable

IsLimitedboolean--

Describes whether the asset is a "limited item" that is no longer (if ever) sold

IsLimitedUniqueboolean--

Describes whether the asset is a "limited unique" ("Limited U") item

IsNewboolean--

Describes whether the asset is marked as "new" in the catalog

Remainingnumber--

The remaining number of items a limited unique item may be sold

Salesnumber--

The number of items the asset has been sold

Namestring--

The name shown on the asset's page

Descriptionstring--

The description as shown on the asset's page; can be nil if blank

PriceInRobuxnumber--

The cost of purchasing the asset using Robux

Createdstring--

Timestamp of when the asset was created, e.g. 2018-08-01T17:55:11.98Z

Updatedstring--

Timestamp of when the asset was last updated by its creator, e.g. 2018-08-01T17:55:11.98Z

ContentRatingTypeIdnumber--

Indicates whether the item is marked as 13+ in catalog

MinimumMembershipLevelnumber--

The minimum subscription level necessary to purchase the item

IsPublicDomainboolean--

Describes whether the asset can be taken for free

}

Product info result for assets.

GamePassOrDeveloperProductInfo

interface GamePassOrDeveloperProductInfo {
CreatorCreatorProductInfo--

A table of information describing the creator of the asset

ProductIdnumber--

If the InfoType was Product, this is the product ID

IconImageAssetIdnumber--

This is the asset ID of the product/pass icon, or 0 if there isn't one

Namestring--

The name shown on the asset's page

Descriptionstring--

The description as shown on the asset's page; can be nil if blank

PriceInRobuxnumber--

The cost of purchasing the asset using Robux

Createdstring--

Timestamp of when the asset was created, e.g. 2018-08-01T17:55:11.98Z

Updatedstring--

Timestamp of when the asset was last updated by its creator, e.g. 2018-08-01T17:55:11.98Z

ContentRatingTypeIdnumber--

Indicates whether the item is marked as 13+ in catalog

MinimumMembershipLevelnumber--

The minimum subscription level necessary to purchase the item

IsPublicDomainboolean--

Describes whether the asset can be taken for free

}

Product info result for gamepasses.

Functions

promiseProductInfo

MarketplaceUtils.promiseProductInfo(
assetIdnumber,
infoTypeInfoType | nil
) → Promise<AssetProductInfo | GamePassOrDeveloperProductInfo>

Wraps MarketplaceService.GetProductInfo and retrieves information about

convertAssetTypeIdToAssetType

MarketplaceUtils.convertAssetTypeIdToAssetType(assetTypeIdnumber) → AssetType | nl

Converts an enum value (retrieved from MarketplaceService) into a proper enum if possible

convertAssetTypeIdToAvatarAssetType

MarketplaceUtils.convertAssetTypeIdToAvatarAssetType(assetTypeIdnumber) → AvatarAssetType | nil

Converts an enum value (retrieved from MarketplaceService) into a proper enum if possible

promiseUserOwnsGamePass

MarketplaceUtils.promiseUserOwnsGamePass(
userIdnumber,
gamePassIdnumber
) → Promise<boolean>

Retrieves whether a player owns a gamepass.

promisePlayerOwnsAsset

MarketplaceUtils.promisePlayerOwnsAsset(
playerPlayer,
assetIdnumber
) → Promise<boolean>

Retrieves whether a player owns an asset, such as a hat or some other item.

promisePlayerOwnsBundle

MarketplaceUtils.promisePlayerOwnsBundle(
playerPlayer,
bundleIdnumber
) → Promise<boolean>

Retrieves whether a player owns a bundle

Show raw api
{
    "functions": [
        {
            "name": "promiseProductInfo",
            "desc": "Wraps [MarketplaceService.GetProductInfo] and retrieves information about",
            "params": [
                {
                    "name": "assetId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "infoType",
                    "desc": "",
                    "lua_type": "InfoType | nil"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<AssetProductInfo | GamePassOrDeveloperProductInfo>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 70,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        },
        {
            "name": "convertAssetTypeIdToAssetType",
            "desc": "Converts an enum value (retrieved from MarketplaceService) into a proper enum if possible",
            "params": [
                {
                    "name": "assetTypeId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AssetType | nl"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 96,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        },
        {
            "name": "convertAssetTypeIdToAvatarAssetType",
            "desc": "Converts an enum value (retrieved from MarketplaceService) into a proper enum if possible",
            "params": [
                {
                    "name": "assetTypeId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "AvatarAssetType | nil"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 114,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        },
        {
            "name": "promiseUserOwnsGamePass",
            "desc": "Retrieves whether a player owns a gamepass.",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "gamePassId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 132,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        },
        {
            "name": "promisePlayerOwnsAsset",
            "desc": "Retrieves whether a player owns an asset, such as a hat or some other item.",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 157,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        },
        {
            "name": "promisePlayerOwnsBundle",
            "desc": "Retrieves whether a player owns a bundle",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "bundleId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 182,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        }
    ],
    "properties": [],
    "types": [
        {
            "name": "CreatorProductInfo",
            "desc": "Product info about the creator. See [MarketplaceService.GetProductInfo].",
            "fields": [
                {
                    "name": "CreatorType",
                    "lua_type": "string",
                    "desc": "Either User or Group"
                },
                {
                    "name": "CreatorTargetId",
                    "lua_type": "number",
                    "desc": "The ID of the creator user or group"
                },
                {
                    "name": "Name",
                    "lua_type": "string",
                    "desc": "The name/username of the creator"
                },
                {
                    "name": "Id",
                    "lua_type": "number",
                    "desc": "(Use CreatorTargetId instead)"
                }
            ],
            "source": {
                "line": 23,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        },
        {
            "name": "AssetProductInfo",
            "desc": "Product info result for assets.",
            "fields": [
                {
                    "name": "Creator",
                    "lua_type": "CreatorProductInfo",
                    "desc": "A table of information describing the creator of the asset"
                },
                {
                    "name": "AssetId",
                    "lua_type": "number",
                    "desc": "If InfoType was Asset, this is the ID of the given asset."
                },
                {
                    "name": "AssetTypeId",
                    "lua_type": "number",
                    "desc": "The type of asset (e.g. place, model, shirt)*"
                },
                {
                    "name": "IsForSale",
                    "lua_type": "boolean",
                    "desc": "Describes whether the asset is purchasable"
                },
                {
                    "name": "IsLimited",
                    "lua_type": "boolean",
                    "desc": "Describes whether the asset is a \"limited item\" that is no longer (if ever) sold"
                },
                {
                    "name": "IsLimitedUnique",
                    "lua_type": "boolean",
                    "desc": "Describes whether the asset is a \"limited unique\" (\"Limited U\") item"
                },
                {
                    "name": "IsNew",
                    "lua_type": "boolean",
                    "desc": "Describes whether the asset is marked as \"new\" in the catalog"
                },
                {
                    "name": "Remaining",
                    "lua_type": "number",
                    "desc": "The remaining number of items a limited unique item may be sold"
                },
                {
                    "name": "Sales",
                    "lua_type": "number",
                    "desc": "The number of items the asset has been sold"
                },
                {
                    "name": "Name",
                    "lua_type": "string",
                    "desc": "The name shown on the asset's page"
                },
                {
                    "name": "Description",
                    "lua_type": "string",
                    "desc": "The description as shown on the asset's page; can be nil if blank"
                },
                {
                    "name": "PriceInRobux",
                    "lua_type": "number",
                    "desc": "The cost of purchasing the asset using Robux"
                },
                {
                    "name": "Created",
                    "lua_type": "string",
                    "desc": "Timestamp of when the asset was created, e.g. 2018-08-01T17:55:11.98Z"
                },
                {
                    "name": "Updated",
                    "lua_type": "string",
                    "desc": "Timestamp of when the asset was last updated by its creator, e.g. 2018-08-01T17:55:11.98Z"
                },
                {
                    "name": "ContentRatingTypeId",
                    "lua_type": "number",
                    "desc": "Indicates whether the item is marked as 13+ in catalog"
                },
                {
                    "name": "MinimumMembershipLevel",
                    "lua_type": "number",
                    "desc": "The minimum subscription level necessary to purchase the item"
                },
                {
                    "name": "IsPublicDomain",
                    "lua_type": "boolean",
                    "desc": "Describes whether the asset can be taken for free"
                }
            ],
            "source": {
                "line": 46,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        },
        {
            "name": "GamePassOrDeveloperProductInfo",
            "desc": "Product info result for gamepasses.",
            "fields": [
                {
                    "name": "Creator",
                    "lua_type": "CreatorProductInfo",
                    "desc": "A table of information describing the creator of the asset"
                },
                {
                    "name": "ProductId",
                    "lua_type": "number",
                    "desc": "If the InfoType was Product, this is the product ID"
                },
                {
                    "name": "IconImageAssetId",
                    "lua_type": "number",
                    "desc": "This is the asset ID of the product/pass icon, or 0 if there isn't one"
                },
                {
                    "name": "Name",
                    "lua_type": "string",
                    "desc": "The name shown on the asset's page"
                },
                {
                    "name": "Description",
                    "lua_type": "string",
                    "desc": "The description as shown on the asset's page; can be nil if blank"
                },
                {
                    "name": "PriceInRobux",
                    "lua_type": "number",
                    "desc": "The cost of purchasing the asset using Robux"
                },
                {
                    "name": "Created",
                    "lua_type": "string",
                    "desc": "Timestamp of when the asset was created, e.g. 2018-08-01T17:55:11.98Z"
                },
                {
                    "name": "Updated",
                    "lua_type": "string",
                    "desc": "Timestamp of when the asset was last updated by its creator, e.g. 2018-08-01T17:55:11.98Z"
                },
                {
                    "name": "ContentRatingTypeId",
                    "lua_type": "number",
                    "desc": "Indicates whether the item is marked as 13+ in catalog"
                },
                {
                    "name": "MinimumMembershipLevel",
                    "lua_type": "number",
                    "desc": "The minimum subscription level necessary to purchase the item"
                },
                {
                    "name": "IsPublicDomain",
                    "lua_type": "boolean",
                    "desc": "Describes whether the asset can be taken for free"
                }
            ],
            "source": {
                "line": 63,
                "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
            }
        }
    ],
    "name": "MarketplaceUtils",
    "desc": "Provides utility methods for MarketplaceService",
    "source": {
        "line": 5,
        "path": "src/marketplaceutils/src/Shared/MarketplaceUtils.lua"
    }
}