Skip to content

$commerce

The store, currencies, offers and owned items.

133 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).

clear_random_granted_durables

$commerce.clear_random_granted_durables(user: User)

Server only. Clear out the list of recently granted durables (accessories) for the given user. After this commerce.get_random_granted_durables(..) will return an empty list until more random durables are granted.

ParameterTypeMeaning
userUserThe user.

clear_users_equipment

read-only
$commerce.clear_users_equipment()

Clear the local cached equipment for all arbitrary users.

clear_users_equipment_by_users

read-only
$commerce.clear_users_equipment_by_users(users: list)

Clear the local cached equipment for a set of arbitrary users.

ParameterTypeMeaning
userslistThe users to clear

confirm_platform_purchase

$commerce.confirm_platform_purchase()

Confirms the platform purchase and transfers goods into the inventory.

crew_clear_equipped

$commerce.crew_clear_equipped(user: User)

Clear the local cache of crew equipment.

ParameterTypeMeaning
userUserThe user

crew_equip

$commerce.crew_equip(accessories: list, user: User, is_debug: bool)

Equip crew accessories.

ParameterTypeMeaning
accessorieslistA list of references to .accessory files to equip.
userUserThe user - should be the crew captain.
is_debugboolTrue if this is a debug call.

deposit

$commerce.deposit(currency: Reference, amount: int, user: User)

Deposit funds into the user's account.

ParameterTypeMeaning
currencyReferenceThe currency.
amountintThe amount to deposit.
userUserThe user for whom we're depositing.

equip

$commerce.equip(accessories: list, character_index: int, user: User, is_debug: bool)

Equip accessories.

ParameterTypeMeaning
accessorieslistA list of references to .accessory files to equip.
character_indexintThe index of the character to whom we are equipping the accessories. This does not apply to all accessory types.
userUserThe user.
is_debugboolTrue if this is a debug call.

get_backfill_commerce_offer

read-only
$commerce.get_backfill_commerce_offer(offer_to_replace: Reference, season_schedule: Reference, year_schedule: Reference, historical_schedule: Reference, exclude_schedule: Reference, current_offers: list, season_day: int, year_day: int, debug_log_level: int, seed: int) -> Reference

Retrieve a vcommerce_catalog_item_t from the catalog for backfill.

ParameterTypeMeaning
offer_to_replaceReference(optional) The offer to be replaced. A ref to a _commerce_offer_t
season_scheduleReferenceThe commerce_schedule for the current season
year_scheduleReferenceThe commerce schedule for the current year
historical_scheduleReferenceThe commerce_schedule from previous years and events
exclude_scheduleReferenceA commerce schedule containing offers which should be excluded from backfill
current_offerslistA list of offers currently present in the Brawl Shop - Daily Items
season_dayintThe day of the current season or event.
year_dayintThe day of the current year.
debug_log_levelint0 for no logging. 1 for basic logging. 2 for detailed list logging.
seedintThe random seed used for backfill.

Returns Reference: A vcommerce_offer_t.

get_balance

read-only
$commerce.get_balance(currency: Reference) -> int

Retrieve the balance of funds for a currency.

ParameterTypeMeaning
currencyReferenceShould be one of k_currency_gold_bars or k_currency_variant_coins.

Returns int: The balance.

get_bundle_background_texture_package

read-only
$commerce.get_bundle_background_texture_package(bundle_info: Reference) -> Reference

Get the background_texture_package of the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns Reference: The background_texture_package.

get_bundle_button_texture_package

read-only
$commerce.get_bundle_button_texture_package(bundle_info: Reference) -> Reference

Get the button_texture_package of the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns Reference: The button_texture_package.

get_bundle_currency

read-only
$commerce.get_bundle_currency(bundle_info: Reference, index: int) -> string

Get the currency included in the bundle_info at the specified index.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.
indexintThe price index. [0, currency_count).

Returns string: The .currency alias (CUR, VAR, et al).

get_bundle_currency_amount

read-only
$commerce.get_bundle_currency_amount(bundle_info: Reference, index: int) -> int

Get quantity of the currency item at the specified index.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.
indexintThe price index. [0, currency_count).

Returns int: The quantity.

get_bundle_currency_count

read-only
$commerce.get_bundle_currency_count(bundle_info: Reference) -> int

Get number of currencies in the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns int: The currencies count.

get_bundle_display_name

read-only
$commerce.get_bundle_display_name(bundle_info: Reference) -> Reference

Get the localized display name of the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns Reference: The display_name.

get_bundle_full_price

read-only
$commerce.get_bundle_full_price(bundle_info: Reference, index: int) -> int

Get the full price of the item in the bundle at the specified index.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.
indexintThe price index. [0, full_price_count).

Returns int: The full_price.

get_bundle_full_price_count

read-only
$commerce.get_bundle_full_price_count(bundle_info: Reference) -> int

Get the number of full price values of the bundle. These should match the items included in the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns int: The full_price_count.

get_bundle_info_matches_id

read-only
$commerce.get_bundle_info_matches_id(bundle_info: Reference, id: string) -> bool

Returns true if the bundle_info contains the id.

ParameterTypeMeaning
bundle_infoReferenceA ref to a vcatch_store_bundle_t.
idstringA platform offer id as a string.

Returns bool: True if the vcatch_store_bundle_info_t contains the id.

get_bundle_item_quantity

read-only
$commerce.get_bundle_item_quantity(bundle_info: Reference, index: int) -> int

Get the quanity of the item in the bundle at the specified index.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.
indexintThe price index. [0, preview_accessory_count).

Returns int: The quantity.

get_bundle_logo_texture_package

read-only
$commerce.get_bundle_logo_texture_package(bundle_info: Reference) -> Reference

Get the logo_texture_package of the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns Reference: The logo_texture_package.

get_bundle_name

read-only
$commerce.get_bundle_name(bundle_info: Reference) -> string

Get the name of the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns string: The name.

get_bundle_offer

read-only
$commerce.get_bundle_offer(bundle_info: Reference) -> Reference

Get the commerce_offer for the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns Reference: The offer.

get_bundle_original_cost

read-only
$commerce.get_bundle_original_cost(bundle_info: Reference) -> int

Get the original cost of the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns int: The original_cost.

get_bundle_owned

read-only
$commerce.get_bundle_owned(bundle_info: Reference) -> bool

Get the ownership status of a bundle. This should only be used to check the ownership of real money bundles.

ParameterTypeMeaning
bundle_infoReferenceThe bundle to check.

Returns bool: True if the bundle is owned.

get_bundle_preview_accessory

read-only
$commerce.get_bundle_preview_accessory(bundle_info: Reference, index: int) -> Reference

Get the preview_accessory from the bundle at the specified index.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.
indexintThe accessory index. [0, preview_accessory_count).

Returns Reference: The preview_accessory.

get_bundle_preview_accessory_count

read-only
$commerce.get_bundle_preview_accessory_count(bundle_info: Reference) -> int

Get the number of preview accessories in the bundle.

ParameterTypeMeaning
bundle_infoReferenceThe bundle_info.

Returns int: The preview_accessory_count.

get_bundle_schedule_bundle_info

read-only
$commerce.get_bundle_schedule_bundle_info(schedule: Reference, index: int) -> Reference

Get the bundle_info at the index in the schedule.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the bundle_info.

Returns Reference: The bundle_info ref for the bundle.

get_bundle_schedule_end_day

read-only
$commerce.get_bundle_schedule_end_day(schedule: Reference, index: int) -> int

Get get day value of the bundle's scheduled end date.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the offer.

Returns int: The day value of the end date.

get_bundle_schedule_end_month

read-only
$commerce.get_bundle_schedule_end_month(schedule: Reference, index: int) -> int

Get get month value of the bundle's scheduled end date.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the offer.

Returns int: The month value of the end date.

get_bundle_schedule_end_year

read-only
$commerce.get_bundle_schedule_end_year(schedule: Reference, index: int) -> int

Get get year value of the bundle's scheduled end date.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the offer.

Returns int: The year value of the end date.

get_bundle_schedule_has_end

read-only
$commerce.get_bundle_schedule_has_end(schedule: Reference, index: int) -> bool

Get whether the bundle at the index in the schedule has an end date.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the offer.

Returns bool: True if the bundle offer has an end date.

get_bundle_schedule_has_start

read-only
$commerce.get_bundle_schedule_has_start(schedule: Reference, index: int) -> bool

Get whether the bundle at the index in the schedule has a start date.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the offer.

Returns bool: True if the bundle offer has a start date.

get_bundle_schedule_length

read-only
$commerce.get_bundle_schedule_length(schedule: Reference) -> int

Get the number of offers in the schedule.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.

Returns int: The length of the list of offers in the schedule.

get_bundle_schedule_start_day

read-only
$commerce.get_bundle_schedule_start_day(schedule: Reference, index: int) -> int

Get get day value of the bundle's scheduled start date.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the offer.

Returns int: The day value of the start date.

get_bundle_schedule_start_month

read-only
$commerce.get_bundle_schedule_start_month(schedule: Reference, index: int) -> int

Get get month value of the bundle's scheduled start date.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the offer.

Returns int: The month value of the start date.

get_bundle_schedule_start_year

read-only
$commerce.get_bundle_schedule_start_year(schedule: Reference, index: int) -> int

Get get year value of the bundle's scheduled start date.

ParameterTypeMeaning
scheduleReferenceThe bundle schedule.
indexintThe index of the offer.

Returns int: The year value of the start date.

get_catalog_offer

read-only
$commerce.get_catalog_offer(index: int) -> Reference

Retrieve a vcommerce_catalog_item_t from the catalog.

ParameterTypeMeaning
indexintThe index of the catalog item. Must be in the range [0, commerce.get_catalog_offer_count()).

Returns Reference: A reference to a vcommerce_catalog_item_t.

get_catalog_offer_count

read-only
$commerce.get_catalog_offer_count() -> int

Retrieve the number of offered items in the catalog.

Returns int: The number of offered items.

get_catalog_offer_for_day

read-only
$commerce.get_catalog_offer_for_day(schedule: Reference, day: int, slot: int) -> Reference

Get a daily offer from the catalog.

ParameterTypeMeaning
scheduleReferenceA season's commerce_schedule.
dayintThe season day.
slotintThe store slot to query [0-schedule.days[day].offer_slots.length).

Returns Reference: Reference to a vcommerce_catalog_item_t.

get_catalog_offer_from_commerce_offer

read-only
$commerce.get_catalog_offer_from_commerce_offer(offer: Reference) -> Reference

Get a offer from the catalog based on a commerce offer.

ParameterTypeMeaning
offerReferenceA reference to a commerce offer.

Returns Reference: Reference to a vcommerce_catalog_item_t.

get_catalog_offers_matching

read-only
$commerce.get_catalog_offers_matching(currency: Reference, accessory: Reference, currency_granted: Reference, max_offers: int, min_price: int, max_price: int) -> list

Retrieve a list of vcommerce_catalog_item_t from the catalog that match the optional arguments.

ParameterTypeMeaning
currencyReference(optional) The currency to look for. (A reference to a .currency file.)
accessoryReference(optional) The accessory to look for. (A reference to a .accessory file.)
currency_grantedReference(optional) The currency granted to look for. (A reference to a .currency file.)
max_offersint(optional) The maximum number of offers to add to the list. If default (0) is passed, it will return all matches.
min_priceint(optional) The minimum price for the offer.
max_priceint(optional) The maximum price for the offer.

Returns list: A list of references to vcommerce_catalog_item_t.

get_code_redemption_item_guid

read-only
$commerce.get_code_redemption_item_guid(item_index: int) -> string

Get the GUID for an item at a given index.

ParameterTypeMeaning
item_indexintIndex of into commerce->code_redemption_items

Returns string: GUID of item at index.

get_code_redemption_item_quantity

read-only
$commerce.get_code_redemption_item_quantity(item_index: int) -> int

Get the quantity for an item at a given index.

ParameterTypeMeaning
item_indexintIndex of into commerce->code_redemption_items

Returns int: Quantity of item at index.

get_code_redemption_items_count

read-only
$commerce.get_code_redemption_items_count() -> int

Get number of items redeemed from the last code redemption request.

Returns int: Number of code redemption items.

get_code_redemption_state

$commerce.get_code_redemption_state() -> int

Get state of the last code redemption request.

Returns int: Enum value of type vonline_commerce_code_redemption_state_t

get_commerce_offer_for_day

read-only
$commerce.get_commerce_offer_for_day(schedule: Reference, day: int, slot: int) -> Reference

Get a daily offer from a commerce_schedule.

ParameterTypeMeaning
scheduleReferenceA season's commerce_schedule.
dayintThe season day.
slotintThe store slot to query [0-schedule.days[day].offer_slots.length).

Returns Reference: Reference to a .commerce_offer.

get_commerce_offer_items

read-only
$commerce.get_commerce_offer_items(offer: Reference) -> list

Get the contents purchased through the offer. This will be a list of refs to .accessory files.

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_offer_t.

Returns list: The list of .accessory file references.

get_commerce_offer_purchase_limit

read-only
$commerce.get_commerce_offer_purchase_limit(offer: Reference) -> int

Get purchase limit of the offer.

ParameterTypeMeaning
offerReferenceA reference to the .commerce_offer.

Returns int: The purchase limit.

get_commerce_offer_slot_accessories

read-only
$commerce.get_commerce_offer_slot_accessories(offer: Reference, slot_index: int) -> list

Get the accessories in the commerce offer slot

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_offer_t.
slot_indexintThe slot index of the item in the offer.

Returns list: The accessories in the commerce offer slot.

get_commerce_offer_slot_count

read-only
$commerce.get_commerce_offer_slot_count(offer: Reference) -> int

Get the number of item slots in the commerce offer

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_offer_t.

Returns int: The number of items in the commerce offer.

get_commerce_offer_slot_quantity

read-only
$commerce.get_commerce_offer_slot_quantity(offer: Reference, slot_index: int) -> int

Get the quantity of items in the commerce offer slot

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_offer_t.
slot_indexintThe slot index of the item in the offer.

Returns int: The number quantity of items in the commerce offer slot.

get_crew_inventory_contains_durable

read-only
$commerce.get_crew_inventory_contains_durable(durable: Reference) -> bool

Search a player's crew inventory to see if it contains a given durable

ParameterTypeMeaning
durableReferenceThe durable to look for (a reference to a .accessory file).

Returns bool: If the inventory contains the given durable.

get_crew_inventory_durable_accessory

read-only
$commerce.get_crew_inventory_durable_accessory(index: int) -> Reference

Retrieve a durable from the player's crew inventory.

ParameterTypeMeaning
indexintThe index of the durable to return. Must be in the range [0, commerce.get_inventory_durable_count()).

Returns Reference: A ref to the .accessory for the durable.

get_crew_inventory_durable_by_type_accessory

read-only
$commerce.get_crew_inventory_durable_by_type_accessory(type: int, index: int) -> Reference

Retrieve a durable from the player's crew inventory.

ParameterTypeMeaning
typeintThe type of the durable to look for. (vcatch_accessory_type_t)
indexintThe index of the durable in the subset of accessories of its type to return. Must be in the range [0, commerce.get_inventory_durable_by_type_count()).

Returns Reference: A ref to the .accessory for the durable.

get_crew_inventory_durable_by_type_count

read-only
$commerce.get_crew_inventory_durable_by_type_count(type: int) -> int

Retrieve the number of durables of the given type in a player's crew inventory. These are what they 'own,' not what they're 'wearing.'

ParameterTypeMeaning
typeintThe type of the durable to look for. (vcatch_accessory_type_t)

Returns int: The number of durables of the given type.

get_crew_inventory_durable_count

read-only
$commerce.get_crew_inventory_durable_count() -> int

Retrieve the number of durables in a player's crew inventory. These are what they 'own,' not what they're 'wearing.'

Returns int: The number of durables.

get_crew_inventory_durable_unlock_count

read-only
$commerce.get_crew_inventory_durable_unlock_count(durable: Reference) -> int

Search a player's crew inventory for a given durable & return the number of users in the crew who have purchased/unlocked it.

ParameterTypeMeaning
durableReferenceThe durable to look for (a reference to a .accessory file).

Returns int: Number of crew members who own the durable.

get_crew_inventory_durables_by_type_accessory

read-only
$commerce.get_crew_inventory_durables_by_type_accessory(type: int) -> list

Retrieve a list of durables from the player's crew inventory.

ParameterTypeMeaning
typeintThe type of the durables to look for. (vcatch_accessory_type_t)

Returns list: A list of refs to .accessory for the durables.

get_crew_inventory_exists

read-only
$commerce.get_crew_inventory_exists() -> bool

Check if the players crew inventory exists

Returns bool: If the inventory contains the given durable.

get_currency_with_alias

read-only
$commerce.get_currency_with_alias(currencies: list, alias: string) -> Reference

Searches a list of .currency refs for one whose alias matches the specified alias.

ParameterTypeMeaning
currencieslistThe list of .currency refs.
aliasstringThe currency alias to match.

Returns Reference: The matching .currency ref

get_inventory_consumable_accessory

read-only
$commerce.get_inventory_consumable_accessory(index: int, user: User) -> Reference

Retrieve a consumable from the player's inventory.

ParameterTypeMeaning
indexintThe index of the consumable to return. Must be in the range [0, commerce.get_inventory_consumable_count()).
userUserThe user.

Returns Reference: A ref to the .accessory for the consumable.

get_inventory_consumable_by_type_count

read-only
$commerce.get_inventory_consumable_by_type_count(type: int, user: User) -> int

Retrieve the number of consumables of the given type in a player's inventory.

ParameterTypeMeaning
typeintThe type of the consumable to look for. (vcatch_accessory_type_t)
userUserThe user.

Returns int: The number of consumables of the given type.

get_inventory_consumable_by_type_index

read-only
$commerce.get_inventory_consumable_by_type_index(type: int, index: int, user: User) -> int

Retrieve the index of a consumable in a player's inventory, or -1 on failure.

ParameterTypeMeaning
typeintThe type of the consumable to look for. (vcatch_accessory_type_t)
indexintThe index of the consumable in the subset of accessories of its type whose index to return. Must be in the range [0, commerce.get_inventory_consumable_by_type_count()).
userUserThe user.

Returns int: The index in the range [0, commerce.get_inventory_consumable_count()).

get_inventory_consumable_count

read-only
$commerce.get_inventory_consumable_count(user: User) -> int

Retrieve the number of consumables in a player's inventory.

ParameterTypeMeaning
userUserThe user.

Returns int: The number of consumables.

get_inventory_consumable_index

read-only
$commerce.get_inventory_consumable_index(consumable: Reference, user: User) -> int

Return the index of a consumable in a player's consumable inventory, or -1 if the consumable was not found in the player's inventory.

ParameterTypeMeaning
consumableReferenceThe consumable to look for (a reference to a .accessory file).
userUserThe user.

Returns int: The index in the range [0, commerce.get_inventory_consumable_count()).

get_inventory_consumable_quantity

read-only
$commerce.get_inventory_consumable_quantity(index: int, user: User) -> int

Return the quantity of a given consumable a player owns.

ParameterTypeMeaning
indexintThe index of the consumable to query. Must be in the range [0, commerce.get_inventory_consumable_count()).
userUserThe user.

Returns int: The quantity of the consumable.

get_inventory_contains_durable

read-only
$commerce.get_inventory_contains_durable(durable: Reference, restrict_platform: bool) -> bool

Search a player's inventory to see if it contains a given durable

ParameterTypeMeaning
durableReferenceThe durable to look for (a reference to a .accessory file).
restrict_platformboolIf true the the accessory must also match the current platform.

Returns bool: If the inventory contains the given durable.

get_inventory_durable_accessory

read-only
$commerce.get_inventory_durable_accessory(index: int) -> Reference

Retrieve a durable from the player's inventory.

ParameterTypeMeaning
indexintThe index of the durable to return. Must be in the range [0, commerce.get_inventory_durable_count()).

Returns Reference: A ref to the .accessory for the durable.

get_inventory_durable_by_type_accessory

read-only
$commerce.get_inventory_durable_by_type_accessory(type: int, index: int) -> Reference

Retrieve a durable from the player's inventory.

ParameterTypeMeaning
typeintThe type of the durable to look for. (vcatch_accessory_type_t)
indexintThe index of the durable in the subset of accessories of its type to return. Must be in the range [0, commerce.get_inventory_durable_by_type_count()).

Returns Reference: A ref to the .accessory for the durable.

get_inventory_durable_by_type_count

read-only
$commerce.get_inventory_durable_by_type_count(type: int) -> int

Retrieve the number of durables of the given type in a player's inventory. These are what they 'own,' not what they're 'wearing.'

ParameterTypeMeaning
typeintThe type of the durable to look for. (vcatch_accessory_type_t)

Returns int: The number of durables of the given type.

get_inventory_durable_count

read-only
$commerce.get_inventory_durable_count() -> int

Retrieve the number of durables in a player's inventory. These are what they 'own,' not what they're 'wearing.'

Returns int: The number of durables.

get_inventory_durables_by_type_accessory

read-only
$commerce.get_inventory_durables_by_type_accessory(type: int, body_type_substring: string, base_only: bool) -> list

Retrieve a list of durables from the player's inventory.

ParameterTypeMeaning
typeintThe type of the durables to look for. (vcatch_accessory_type_t)
body_type_substringstringBody type substring to filter by.
base_onlyboolIf we should filter for base accessories only.

Returns list: A list of refs to .accessory for the durables.

get_inventory_equipped_accessory

read-only
$commerce.get_inventory_equipped_accessory(index: int, user: User) -> Reference

Return a reference to a .accessory file for an equipped accessory.

ParameterTypeMeaning
indexintThe index of the equipped accessory to return. Must be in the range [0, commerce.get_inventory_equipped_count()).
userUserThe user.

Returns Reference: The equipped .accessory ref.

get_inventory_equipped_accessory_by_type_and_index

read-only
$commerce.get_inventory_equipped_accessory_by_type_and_index(accessory_type: int, character_index: int, user: User) -> Reference

Return a reference to a .accessory file for an equipped accessory given an accessory type and a character index.

ParameterTypeMeaning
accessory_typeintThe accessory type to check.
character_indexintThe character index to check.
userUserThe user.

Returns Reference: The equipped .accessory ref.

get_inventory_equipped_count

read-only
$commerce.get_inventory_equipped_count(user: User) -> int

Return the number of equipped accessories.

ParameterTypeMeaning
userUserThe user.

Returns int: The number of equipped accessories.

get_inventory_equipped_slot

read-only
$commerce.get_inventory_equipped_slot(index: int, user: User) -> string

Return a string representing the slot for the equipped index.

ParameterTypeMeaning
indexintThe index of the equipped accessory to return. Must be in the range [0, commerce.get_inventory_equipped_count()).
userUserThe user.

Returns string: The slot string.

get_offer_contents

read-only
$commerce.get_offer_contents(offer: Reference) -> list

Get the contents purchased through the offer. This will be a list of refs to .accessory files.

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_catalog_item_t.

Returns list: The list of .accessory file references.

get_offer_count_for_day

read-only
$commerce.get_offer_count_for_day(schedule: Reference, day: int) -> int

Get the number of offer slots in one day of a commerce_schedule.

ParameterTypeMeaning
scheduleReferenceA .commerce_schedule.
dayintThe day in the schedule.

Returns int: The number of offers in a specific day for the given schedule.

get_offer_currencies

read-only
$commerce.get_offer_currencies(offer: Reference) -> list

Get the currencies purchased through the offer. This will be a list of strings to .currency file aliases (CUR or VAR).

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_catalog_item_t.

Returns list: The list of currency strings.

get_offer_currency_string

read-only
$commerce.get_offer_currency_string(offer: Reference) -> string

Get the currency used for a given offer.

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_catalog_item_t.

Returns string: The currency for the offer.

get_offer_guid_temp

read-only
$commerce.get_offer_guid_temp(offer: Reference) -> string

Get guid of a commerce_offer in a temp string.

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_catalog_item_t.

Returns string: The guid.

get_offer_price

read-only
$commerce.get_offer_price(offer: Reference) -> int

Get the price of a given offer.

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_catalog_item_t.

Returns int: The price.

get_offer_quantities

read-only
$commerce.get_offer_quantities(offer: Reference) -> list

Get quantity of each content item.

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_catalog_item_t.

Returns list: The quantities.

get_offer_quantity

read-only
$commerce.get_offer_quantity(offer: Reference, accessory: Reference) -> int

Get quantity of each content item.

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_catalog_item_t.
accessoryReferenceA reference to the vcatch_accessory_t.

Returns int: The quantity.

get_offer_type_for_day

read-only
$commerce.get_offer_type_for_day(schedule: Reference, day: int, slot: int) -> int

Get a daily offer's type.

ParameterTypeMeaning
scheduleReferenceA season's commerce_schedule.
dayintThe season day.
slotintThe store slot to query [0-schedule.days[day].offer_slots.length).

Returns int: Offer type (vcatch_offer_type_t) e.g. k_offer_type_featured

get_platform_entitlements

read-only
$commerce.get_platform_entitlements() -> list

Get a list of the active platform entitlements.

Returns list: A list of strings of the platform entitlements. NULL if not available

get_platform_offer_count

read-only
$commerce.get_platform_offer_count() -> int

Retrieve the number of platform offers in the catalog.

Returns int: The number of offered items.

get_platform_offer_description

read-only
$commerce.get_platform_offer_description(offer_index: int) -> string

Get the description text of a platform offer.

ParameterTypeMeaning
offer_indexintIndex into the catalog->real_money_offers array.

Returns string: A string containing the description of a vonline_platform_offer_t.

get_platform_offer_id

read-only
$commerce.get_platform_offer_id(offer_index: int) -> string

Get the platform ID of a platform offer.

ParameterTypeMeaning
offer_indexintIndex into the catalog->real_money_offers array.

Returns string: Platform ID of the offer.

get_platform_offer_info_amount

read-only
$commerce.get_platform_offer_info_amount(offer_info: Reference) -> int

Get the amount of a platform_offer_offer_info.

ParameterTypeMeaning
offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.

Returns int: The portion of the offer that is consdered the base amount of currency.

get_platform_offer_info_amount_bonus

read-only
$commerce.get_platform_offer_info_amount_bonus(offer_info: Reference) -> int

Get the bonus amount of a platform_offer_offer_info.

ParameterTypeMeaning
offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.

Returns int: The portion of the offer that is consdered a bonus amount of currency.

get_platform_offer_info_icon

read-only
$commerce.get_platform_offer_info_icon(offer_info: Reference) -> Reference

Get the icon texture of a platform_offer_offer_info.

ParameterTypeMeaning
offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.

Returns Reference: A ref for the texture to display for this offer.

get_platform_offer_info_is_deluxe

read-only
$commerce.get_platform_offer_info_is_deluxe(offer_info: Reference) -> bool

Get the value of the deluxe_edition field of a platform_offer_offer_info.

ParameterTypeMeaning
offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.

Returns bool: A bool describing if the vonline_platform_offer_item_t is for the deluxe edition.

get_platform_offer_info_is_standard

read-only
$commerce.get_platform_offer_info_is_standard(offer_info: Reference) -> bool

Get the value of the standard_edition field of a platform_offer_offer_info.

ParameterTypeMeaning
offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.

Returns bool: A bool describing if the vonline_platform_offer_item_t is for the standard edition.

get_platform_offer_info_matches_id

read-only
$commerce.get_platform_offer_info_matches_id(offer_info: Reference, id: string) -> bool

Returns true if the platform_offer_info contains the id.

ParameterTypeMeaning
offer_infoReferenceA ref to a vcommerce_platform_offer_info_t.
idstringA platform offer id as a string.

Returns bool: True if the vcommerce_platform_offer_info_t contains the id.

get_platform_offer_item_base_price

read-only
$commerce.get_platform_offer_item_base_price(offer_index: int, item_index: int) -> string

Get the formatted base price of a platform offer item.

ParameterTypeMeaning
offer_indexintIndex into the catalog->real_money_offers array.
item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.

Returns string: A formatted string for the base price of a vonline_platform_offer_item_t.

get_platform_offer_item_id

read-only
$commerce.get_platform_offer_item_id(offer_index: int, item_index: int) -> string

Get the platform ID of a platform offer item.

ParameterTypeMeaning
offer_indexintIndex into the catalog->real_money_offers array.
item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.

Returns string: A string with the platform ID of a vonline_platform_offer_item_t.

get_platform_offer_item_name

read-only
$commerce.get_platform_offer_item_name(offer_index: int, item_index: int) -> string

Get the localized name for the item of a platform offer item.

ParameterTypeMeaning
offer_indexintIndex into the catalog->real_money_offers array.
item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.

Returns string: A string containing the name of a vonline_platform_offer_item_t.

get_platform_offer_item_sale_price

read-only
$commerce.get_platform_offer_item_sale_price(offer_index: int, item_index: int) -> string

Get the formatted sale price of a platform offer item.

ParameterTypeMeaning
offer_indexintIndex into the catalog->real_money_offers array.
item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.

Returns string: A formatted string for the sale price of a vonline_platform_offer_item_t.

get_platform_offer_items_count

read-only
$commerce.get_platform_offer_items_count(offer_index: int) -> int

Retrieve the number of items in the platform offer.

ParameterTypeMeaning
offer_indexintIndex into the catalog->real_money_offers array.

Returns int: The number of vonline_platform_offer_item_t in a vonline_platform_offer_t.

get_purchase_result

read-only
$commerce.get_purchase_result() -> int

Retrieve the result of the last call to commerce.purchase().

Returns int: The purchase result of type purchase_result_t.

get_random_granted_durables

$commerce.get_random_granted_durables(user: User) -> list

Server only. Return a (possibly empty) list durables (accessories) granted to the given user.

ParameterTypeMeaning
userUserThe user.

Returns list: The list of recently granted durables.

get_random_reward_accessory_by_index

$commerce.get_random_reward_accessory_by_index(user: User, index: int) -> Reference

Server only. Return accessory of a random reward by index.

ParameterTypeMeaning
userUserThe user to get random reward
indexintThe index of the random reward

Returns Reference: The accessory of the random reward by index.

get_random_reward_quantity_by_index

$commerce.get_random_reward_quantity_by_index(user: User, index: int) -> int

Server only. Return quantity of a random reward by index.

ParameterTypeMeaning
userUserThe user to get random reward
indexintThe index of the random reward

Returns int: The quantity of the random reward by index.

get_random_rewards_length

$commerce.get_random_rewards_length(user: User) -> int

Server only. Return length of the random rewards for a given user.

ParameterTypeMeaning
userUserThe user to get random rewards.

Returns int: The length of the random rewards for a given user.

get_sanitized_price_string

read-only
$commerce.get_sanitized_price_string(price_string: string) -> string

Get the sanitized price string if sanitization of unsupported characters is applicable.

ParameterTypeMeaning
price_stringstringThe price string to be sanitized.

Returns string: The price string, sanitized of any unsupported characters.

get_schedule_days_count

read-only
$commerce.get_schedule_days_count(schedule: Reference) -> int

Get the number of days in a commerce_schedule.

ParameterTypeMeaning
scheduleReferenceA .commerce_schedule.

Returns int: The number of days in a given schedule.

get_schedule_slot_count

read-only
$commerce.get_schedule_slot_count(schedule: Reference, day: int) -> int

Number of slots in a given day in a commerce_schedule.

ParameterTypeMeaning
scheduleReferenceA .commerce_schedule.
dayintThe season day.

Returns int: The number of slots in a given day of a given schedule.

get_tax_message

read-only
$commerce.get_tax_message() -> string

Get the tax message if applicable.

Returns string: Tax message for active region.

get_user_inventory_contains_durable

read-only
$commerce.get_user_inventory_contains_durable(durable: Reference, restrict_platform: bool, user: User) -> bool

Search a specific user's inventory to see if it contains a given durable

ParameterTypeMeaning
durableReferenceThe durable to look for (a reference to a .accessory file).
restrict_platformboolIf true the the accessory must also match the current platform.
userUserThe user whose inventory we are searching.

Returns bool: If the user inventory contains the given durable.

grant_consumables

$commerce.grant_consumables(consumables: list, quantities: list, user: User)

Server only. Grant the quantities of a list of consumables for a given user's inventory.

ParameterTypeMeaning
consumableslistThe consumables (references to .accessory files).
quantitieslistThe quantities to add for each of the consumables.
userUserThe user.

grant_durables

$commerce.grant_durables(durables: list, user: User, exclude_owned: bool)

Server only. Add a list of durables directly to a user's inventory.

ParameterTypeMeaning
durableslistThe list of durables to grant. For Catch, references to .accessory files.
userUserThe user.
exclude_ownedboolShould owned items be excluded from the grant.

grant_durables_from_catalogs

$commerce.grant_durables_from_catalogs(catalogs: list, user: User)

Intended for debug purposes. Grant all durables from a list of catalog.vscript components.

ParameterTypeMeaning
catalogslistList of catalog components.
userUserThe user.

has_arbitrary_user_equipment

read-only
$commerce.has_arbitrary_user_equipment(user: User) -> bool

Returns if the user has their equipment in the equipment cache.

ParameterTypeMeaning
userUserThe user to check

Returns bool: True if the user's equipment is in the cache.

has_received_equipment_for_user

read-only
$commerce.has_received_equipment_for_user(user: User) -> bool

Return whether any equipment data has been received from the backend for the given user. Whether or not the equipment is resolvable to an accessory file locally is irrelevant. Will return false for a user with no equipment data on the backend (a new user for instance).

ParameterTypeMeaning
userUserThe user.

Returns bool: Whether or not equipment data has been received for the given user.

has_received_equipment_for_user_by_slot

read-only
$commerce.has_received_equipment_for_user_by_slot(user: User, character_index: int) -> bool

Return whether any equipment data has been received from the backend for the given user on a given slot. Whether or not the equipment is resolvable to an accessory file locally is irrelevant. Will return false for a user with no equipment data on the backend (a new user for instance).

ParameterTypeMeaning
userUserThe user.
character_indexintThe character index.

Returns bool: Whether or not equipment data has been received for the given user.

is_commerce_offer_consumable

read-only
$commerce.is_commerce_offer_consumable(offer: Reference) -> bool

Returns true if the commerce offer contains a consumable item as its first item.

ParameterTypeMeaning
offerReferenceA reference to the vcommerce_offer_t.

Returns bool: If the commerce offer contains a consumable item as its first item.

is_platform_offer_item_on_sale

read-only
$commerce.is_platform_offer_item_on_sale(offer_index: int, item_index: int) -> bool

Is the platform offer item on sale?

ParameterTypeMeaning
offer_indexintIndex into the catalog->real_money_offers array.
item_indexintIndex into the catalog->real_money_offers[offer_index]->items array.

Returns bool: A bool describing if the vonline_platform_offer_item_t is on sale.

open_packs

$commerce.open_packs(packs: list, user: User, suppress_message: bool)

Server only. Open a list of packs into the user's inventory.

ParameterTypeMeaning
packslistA list of references to .random_reward files.
userUserThe user.
suppress_messageboolPass in true if you don't wish to receive an 'event net_random_durables_granted' on success.

open_platform_store

$commerce.open_platform_store()

Opens the first party store and show the games offers.

purchase

$commerce.purchase(offer: Reference)

Purchase an offer.

ParameterTypeMeaning
offerReferenceA reference to a vcommerce_catalog_item_t.

purchase_platform_offer

$commerce.purchase_platform_offer(offer_id: string)

Purchase a platform offer.

ParameterTypeMeaning
offer_idstringThe platform ID of the vonline_platform_offer_t to purchase.

redeem_code

$commerce.redeem_code(code: string)

Redeem a code.

ParameterTypeMeaning
codestringThe code to redeem.

refresh_crew

$commerce.refresh_crew()

Query the backend to get our updated crew inventory.

request_users_equipment

read-only
$commerce.request_users_equipment(users: list)

Request the equipment for a set of arbitrary users.

ParameterTypeMeaning
userslistThe users to request the inventory for

reset_account

$commerce.reset_account(user: User)

Debug function to reset an account to the initial state.

ParameterTypeMeaning
userUserThe user.

set_consumables

$commerce.set_consumables(consumables: list, quantities: list, user: User)

Server only. Set the quantities of a list of consumables for a given user's inventory. Requires that the consumable is already in the inventory.

ParameterTypeMeaning
consumableslistThe consumables (references to .accessory files).
quantitieslistThe new quantities of each of the consumables.
userUserThe user.

set_store_icon

$commerce.set_store_icon(state: int)

Set the state of the first party store icon (PlayStation only).

ParameterTypeMeaning
stateintThe icon state. See k_vonline_icon_left, etc.

show_empty_store_dialog

$commerce.show_empty_store_dialog() -> bool

Show the system empty store dialog (PlayStation only).

Returns bool: A bool describing if any action was taken to open a dialog for the platform.