Skip to main content

marketPlaceServiceUtil

An utility module for working with MarketplaceService.

Functions

productInfoPromise

marketPlaceServiceUtil.productInfoPromise(
assetIdnumber,
infoTypeEnum.InfoType?
) → Promise<ProductInfo>

Returns a promise which is resolved wih the product info of the given place id.

userOwnsGamepassPromise

marketPlaceServiceUtil.userOwnsGamepassPromise(
userIdnumber,
gamepassIdnumber
) → Promise<boolean>

Returns a promise which is resolved with a boolean indicating if the user owns the specified gamepass or not. Incase the operation fails, the promise will reject with an additional value i.e the error message.

local wasSucessfull, userOwnsGamepass, errorMessage = marketPlaceServiceUtil.userOwnsGamepassPromise(123, 45678123):await()

if wasSucessfull then
	print(userOwnsGamepass)
else 
	print(userOwnsGamepass) --> false
	print(errorMessage)
end

playerOwnsAssetPromise

marketPlaceServiceUtil.playerOwnsAssetPromise(
playerPlayer,
assetIdnumber
) → Promise<boolean>

Returns a promise which is resolved with a boolean indicating if the player owns the specified asset or not. Incase the operation fails, the promise will reject with an additional value i.e the error message.

local wasSucessfull, playerOwnsAsset, errorMessage = marketPlaceServiceUtil.playerOwnsAssetPromise(123, 45678123):await()

if wasSucessfull then
	print(playerOwnsAsset)
else 
	print(playerOwnsAsset) --> false
	print(errorMessage)
end

playerOwnsBundlePromise

marketPlaceServiceUtil.playerOwnsBundlePromise(
playerPlayer,
bundleIdnumber
) → Promise<boolean>

Returns a promise which is resolved with a boolean indicating if the player owns the specified bundle or not. Incase the operation fails, the promise will reject with an additional value i.e the error message.

local wasSucessfull, playerOwnsBundle, errorMessage = marketPlaceServiceUtil.playerOwnsBundlePromise(123, 45678123):await()

if wasSucessfull then
	print(playerOwnsBundle)
else 
	print(playerOwnsBundle) --> false
	print(errorMessage)
end

subscriptionInfoProductPromise

marketPlaceServiceUtil.subscriptionInfoProductPromise(subscriptionIdstring) → Promise<SubscriptionInfo>

Returns a promise which is resolved with the info of the given subscription id.

local wasSucessfull, subscriptionInfo = marketPlaceServiceUtil.subscriptionInfoProductPromise(subscriptionId):await()

if wasSucessfull then
	print(subscriptionInfo)
else
	print(tostring(subscriptionInfo)) -- Error
end

userSubscriptionDetailsPromise

marketPlaceServiceUtil.userSubscriptionDetailsPromise(
playerPlayer,
subscriptionIdstring
) → Promise<UserSubscriptionDetails>

Returns a promise which is resolved with the user subscription details.

local wasSucessfull, userSubscriptionDetails = marketPlaceServiceUtil.userSubscriptionDetailsPromise(player, subscriptionId):await()

if wasSucessfull then
	print(userSubscriptionDetails)
else
	print(tostring(userSubscriptionDetails)) -- Error
end

userSubscriptionPaymentHistoryPromise

marketPlaceServiceUtil.userSubscriptionPaymentHistoryPromise(
playerPlayer,
subscriptionIdstring
) → Promise<UserSubscriptionPaymentHistory>

Returns a promise which is resolved with the user subscription payment history.

local wasSucessfull, userSubscriptionPaymentHistory = marketPlaceServiceUtil.userSubscriptionPaymentHistoryPromise(player, subscriptionId):await()

if wasSucessfull then
	print(userSubscriptionPaymentHistory)
else
	print(tostring(userSubscriptionPaymentHistory)) -- Error
end

userSubscriptionStatusPromise

marketPlaceServiceUtil.userSubscriptionStatusPromise(
playerPlayer,
subscriptionIdstring
) → Promise<UserSubscriptionStatus>

Returns a promise which is resolved with the user subscription payment history.

local wasSucessfull, userSubscriptionStatus = marketPlaceServiceUtil.userSubscriptionStatusPromise(player, subscriptionId):await()

if wasSucessfull then
	print(userSubscriptionStatus)
else
	print(tostring(userSubscriptionStatus)) -- Error
end

activeAssetProductInfoWhichPlayerOwnsPromise

marketPlaceServiceUtil.activeAssetProductInfoWhichPlayerOwnsPromise(
playerUserIdnumber,
assetIdnumber
) → ()

Retrieves the asset product info that belongs to a player of userid playerUserId.

Show raw api
{
    "functions": [
        {
            "name": "productInfoPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved wih the product info of the given\nplace id.",
            "params": [
                {
                    "name": "assetId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "infoType",
                    "desc": "",
                    "lua_type": "Enum.InfoType?"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<ProductInfo>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 36,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        },
        {
            "name": "userOwnsGamepassPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with a boolean indicating\nif the user owns the specified gamepass or not. Incase the operation fails, the promise will reject\nwith an additional value i.e the error message.\n\n```lua\nlocal wasSucessfull, userOwnsGamepass, errorMessage = marketPlaceServiceUtil.userOwnsGamepassPromise(123, 45678123):await()\n\nif wasSucessfull then\n\tprint(userOwnsGamepass)\nelse \n\tprint(userOwnsGamepass) --> false\n\tprint(errorMessage)\nend\n```",
            "params": [
                {
                    "name": "userId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "gamepassId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 61,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        },
        {
            "name": "playerOwnsAssetPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with a boolean indicating\nif the player owns the specified asset or not. Incase the operation fails, the promise will reject\nwith an additional value i.e the error message.\n\n```lua\nlocal wasSucessfull, playerOwnsAsset, errorMessage = marketPlaceServiceUtil.playerOwnsAssetPromise(123, 45678123):await()\n\nif wasSucessfull then\n\tprint(playerOwnsAsset)\nelse \n\tprint(playerOwnsAsset) --> false\n\tprint(errorMessage)\nend\n```",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "assetId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 84,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        },
        {
            "name": "playerOwnsBundlePromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with a boolean indicating\nif the player owns the specified bundle or not. Incase the operation fails, the promise will reject\nwith an additional value i.e the error message.\n\n```lua\nlocal wasSucessfull, playerOwnsBundle, errorMessage = marketPlaceServiceUtil.playerOwnsBundlePromise(123, 45678123):await()\n\nif wasSucessfull then\n\tprint(playerOwnsBundle)\nelse \n\tprint(playerOwnsBundle) --> false\n\tprint(errorMessage)\nend\n```",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "bundleId",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<boolean>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 107,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        },
        {
            "name": "subscriptionInfoProductPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with the info\nof the given subscription id.\n\n```lua\nlocal wasSucessfull, subscriptionInfo = marketPlaceServiceUtil.subscriptionInfoProductPromise(subscriptionId):await()\n\nif wasSucessfull then\n\tprint(subscriptionInfo)\nelse\n\tprint(tostring(subscriptionInfo)) -- Error\nend\n```",
            "params": [
                {
                    "name": "subscriptionId",
                    "desc": "",
                    "lua_type": "string"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<SubscriptionInfo>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 128,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        },
        {
            "name": "userSubscriptionDetailsPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with the\nuser subscription details.\n\n```lua\nlocal wasSucessfull, userSubscriptionDetails = marketPlaceServiceUtil.userSubscriptionDetailsPromise(player, subscriptionId):await()\n\nif wasSucessfull then\n\tprint(userSubscriptionDetails)\nelse\n\tprint(tostring(userSubscriptionDetails)) -- Error\nend\n```",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "subscriptionId",
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<UserSubscriptionDetails>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 151,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        },
        {
            "name": "userSubscriptionPaymentHistoryPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with the\nuser subscription payment history.\n\n```lua\nlocal wasSucessfull, userSubscriptionPaymentHistory = marketPlaceServiceUtil.userSubscriptionPaymentHistoryPromise(player, subscriptionId):await()\n\nif wasSucessfull then\n\tprint(userSubscriptionPaymentHistory)\nelse\n\tprint(tostring(userSubscriptionPaymentHistory)) -- Error\nend\n```",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "subscriptionId",
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<UserSubscriptionPaymentHistory>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 177,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        },
        {
            "name": "userSubscriptionStatusPromise",
            "desc": "Returns a [promise](https://eryn.io/roblox-lua-promise/) which is resolved with the\nuser subscription payment history.\n\n```lua\nlocal wasSucessfull, userSubscriptionStatus = marketPlaceServiceUtil.userSubscriptionStatusPromise(player, subscriptionId):await()\n\nif wasSucessfull then\n\tprint(userSubscriptionStatus)\nelse\n\tprint(tostring(userSubscriptionStatus)) -- Error\nend\n```",
            "params": [
                {
                    "name": "player",
                    "desc": "",
                    "lua_type": "Player"
                },
                {
                    "name": "subscriptionId",
                    "desc": "",
                    "lua_type": "string\n"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "Promise<UserSubscriptionStatus>"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 203,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        },
        {
            "name": "activeAssetProductInfoWhichPlayerOwnsPromise",
            "desc": " \nRetrieves the asset product info that belongs to a player of userid `playerUserId`.",
            "params": [
                {
                    "name": "playerUserId",
                    "desc": "",
                    "lua_type": "number"
                },
                {
                    "name": "assetId",
                    "desc": "",
                    "lua_type": "number\n"
                }
            ],
            "returns": [],
            "function_type": "static",
            "source": {
                "line": 216,
                "path": "src/marketPlaceServiceUtil/init.luau"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "marketPlaceServiceUtil",
    "desc": "An utility module for working with [MarketplaceService](https://create.roblox.com/docs/reference/engine/classes/MarketplaceService).",
    "source": {
        "line": 6,
        "path": "src/marketPlaceServiceUtil/init.luau"
    }
}