In-game purchase

Call the purchase related methods so that you can view in-app purchase results on dashboard in the console.

Purchase currency

When a user make a payment to acquire different types of in-game currency, call the following methods.

  • Call InAppPurchase and GetCurrency when a user pays cash for in-game currency such as gem or diamond.

    • InAppPurhcase method is used only when a user pays in cash (that is, real money).

    • Enter the type of purchased item such as event, package, currency, or consumable in from_category_slug.

    • To record that purchased game currency is paid in cash, enter entity.InAppPurchase in from_entity for GetCurrency method.

    When paid in cash, purchasable_slug for InAppPurchase method and from_slug from GetCurrency method must share the same input value. In the table below, it is 120 diamonds as an example value.

    Method Parameter Type Required Notes

    InAppPurchase

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    purchasable_slug

    string

    Required

    120 diamonds

    purchase_quantity

    float

    Required

    1

    purchase_unit_price

    float

    Required

    3300

    purchase_total_price

    float

    Required

    purchase_currency_code

    Required

    currencyCode.KRW

    is_ad_remove

    boolean

    Optional

    FALSE

    Method Parameter Type Required Notes

    GetCurrency

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    currency_slug

    string

    Required

    diamond

    currency_quantity

    float

    Required

    120

    currency_total_quantity

    float

    Optional

    9999

    from_entity

    Optional

    entity.InAppPurchase

    from_category_slug

    string

    Optional

    currency

    from_slug

    string

    Optional

    120 diamonds

  • Call UseCurrency and GetCurrency when a user pays Hard Currency (that is, currency that can only be acquired through cash payment) to acquire Soft Currency (that is, currency that can be acquired through game play).

    Since the purchase of soft currency by hard currency takes place in an in-app store, enter entity.ShopPurchase in where_to_entity from UseCurrency method and in from_entity from GetCurrency method.

    Since user pays hard currency for a certain item that yield soft currency in return, where_to_slug for UseCurrency method and from_slug for GetCurrency method must share the same label for the item, while where_to_category_slug for UseCurrency and from_category_slug for GetCurrency must share the same label for the item category.

    In the table below, it is 1000 gold and gold for each example value.

    Method Parameter Type Required Notes

    UseCurrency

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    currency_slug

    string

    Required

    diamonds

    currency_quantity

    float

    Required

    50

    currency_total_quantity

    float

    Optional

    9999

    where_to_entity

    Optional

    entity.ShopPurchase

    where_to_category_slug

    string

    Optional

    gold

    where_to_slug

    string

    Optional

    1000 gold

    Method Parameter Type Required Notes

    GetCurrency

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    currency_slug

    string

    Required

    gold

    currency_quantity

    float

    Required

    1000

    currency_total_quantity

    float

    Optional

    9999

    from_entity

    Optional

    entity.ShopPurchase

    from_category_slug

    string

    Optional

    gold

    from_slug

    string

    Optional

    1000 gold

Purchase random box

When a user pays cash to purchase random box item, call the following methods.

  • Call the following methods when a specific item is acquired immediately after purchasing a random box.

    When recording item or currency that can be acquired from a random box, purchasable_slug for InAppPurchase method and from_slug for GetRandomBox and GetEquipment method must share the same input value. In the table below, it is written as "common firearm random box".

    Method Parameter Type Required Notes

    InAppPurchase

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    purchasable_slug

    string

    Required

    common firearm random box

    purchase_quantity

    float

    Required

    1

    purchase_unit_price

    float

    Required

    3300

    purchase_total_price

    float

    Required

    purchase_currency_code

    Required

    currencyCode.KRW

    is_ad_remove

    boolean

    Optional

    FALSE

    Method Parameter Type Required Notes

    GetRandomBox

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    TentuPlayKeyword._DUMMY_CHARACTER_ID_

    item_slug

    string

    Required

    common firearm random box

    item_quantity

    float

    Required

    1

    from_entity

    Optional

    entity.InAppPurchase

    from_category_slug

    string

    Optional

    firearm store

    from_slug

    string

    Optional

    common firearm random box

    Method Parameter Type Required Notes

    OpenRandomBox

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    TentuPlayKeyword._DUMMY_CHARACTER_ID_

    item_slug

    string

    Required

    common firearm random box

    item_quantity

    float

    Required

    1

    Method Parameter Type Required Notes

    GetEquipment

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    TentuPlayKeyword._DUMMY_CHARACTER_ID_

    item_slug

    string

    Required

    A firearm

    item_quantity

    float

    Required

    1

    from_entity

    Optional

    entity.OpenRandomBox

    from_category_slug

    string

    Optional

    common

    from_slug

    string

    Optional

    common firearm random box

  • Call InAppPurchase and GetRandomBox when a certain random box acquired from purchase can be opened any time at user’s disposal.

    When a user opens a certain random box in the future to acquire a certain object, call OpenRandomBox and GetRandomBox.

    Method Parameter Type Required Notes

    InAppPurchase

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    purchasable_slug

    string

    Required

    Alegoria Box

    purchase_quantity

    float

    Required

    1

    purchase_unit_price

    float

    Required

    3300

    purchase_total_price

    float

    Required

    purchase_currency_code

    Required

    currencyCode.KRW

    is_ad_remove

    boolean

    Optional

    FALSE

    Method Parameter Type Required Notes

    GetRandomBox

    player_uuid

    string

    Required

    character_uuid

    string

    Required

    TentuPlayKeyword._DUMMY_CHARACTER_ID_

    item_slug

    string

    Required

    Alegoria Box

    item_quantity

    float

    Required

    1

    from_entity

    Optional

    entity.InAppPurchase

    from_category_slug

    string

    Optional

    Diadium (store name)

    from_slug

    string

    Optional

    Alegoria Box × 1

Purchase package item

When a user pays cash to purchase a package item that includes multiple items, call InAppPurchase along with Get{ Object } methods.

TentuPlay algorithm provides 10 different types of in-game object, such as Character, Currency, and Equipment. For each type of Object, you can call the method in Get{ Object } format such as GetEquipment or GetCosmetic. For more information about Object type, see Entities.

Let’s assume that a user has purchased "monster summoning package 1" that contains two currencies (that is, "gem" and "cosmo") and a token (namely, "premium ticket"). In this case, you need to call InAppPurchase, GetToken, and GetCurrency two times as shown in the following table:

Method Parameter Type Required Notes

InAppPurchase

player_uuid

string

Required

character_uuid

string

Required

TentuPlayKeyword._DUMMY_CHARACTER_ID_

purchasable_slug

string

Required

monster summoning package 1

purchase_quantity

float

Required

1

purchase_unit_price

float

Required

29000

purchase_total_price

float

Required

purchase_currency_code

Required

currencyCode.KRW

is_ad_remove

boolean

Optional

FALSE

Method

Parameter

Type

Required

Notes

Currency A

Currency B

GetCurrency

player_uuid

string

Required

character_uuid

string

Required

TentuPlayKeyword._DUMMY_CHARACTER_ID_

currency_slug

string

Required

gem

cosmo

currency_quantity

float

Required

3300

50

currency_total_quantity

float

Optional

99990

9999

from_entity

Optional

entity.ShopPurchase

from_category_slug

string

Optional

monster summon

from_slug

string

Optional

monster summoning package 1

Method Parameter Type Required Notes

GetToken

player_uuid

string

Required

character_uuid

string

Required

TentuPlayKeyword._DUMMY_CHARACTER_ID_

item_slug

string

Required

premium ticket

item_quantity

float

Required

2

from_entity

Optional

entity.InAppPurchase

from_category_slug

string

Optional

monster summon

from_slug

string

Optional

monster summoning package 1

Purchase ad-removal

Call InAppPurchase when a user pays cash to purchase the ad-removal item.

Enter TRUE in is_ad_remove of the InAppPurchase method when purchasing the ad-removal.

Method Parameter Type Required Notes

InAppPurchase

player_uuid

string

Required

character_uuid

string

Required

purchasable_slug

string

Required

ad_removal item name

purchase_quantity

float

Required

1

purchase_unit_price

float

Required

16000

purchase_total_price

float

Required

purchase_currency_code

Required

currencyCode.KRW

is_ad_remove

boolean

Optional

TRUE