TikTok for Developers

Developer Docs

Last updated October 5, 2026

In-App Purchases

The In-App Purchase APIs enable players to buy virtual goods, check balances, recharge coins, and navigate to the balance management page.

TT.Pay(param)

Initiates an In-App Purchase. The player will see a payment dialog for the specified product.

Signature

public static void Pay(PayParam param)

Parameters

Field

Type

Description

Required

mode

string

Payment mode (gamecoin for coins, gameitem for items)

Yes

env

int

Environment (0 for production, 1 for sandbox)

Yes

currency

string

Currency type

No

platform

string

Payment platform (android, ios)

No

buyQuantity

int

Quantity to purchase (for gamecoin mode, must be a multiple of currencyMultiplier)

No

zoneId

string

Zone ID

No

customId

string

Custom order ID for tracking

No

extraInfo

string

Additional order information in JSON format

No

Success

Action<PayResult>

Success callback

No

Fail

Action<ErrorInfo>

Failure callback

No

Complete

Action

Completion callback

No

Example

TT.Pay(new PayParam
{
    mode = "gamecoin",
    env = 0,
    currency = "diamond",
    platform = "android",
    buyQuantity = 100,
    Success = result => Debug.Log("Payment succeeded"),
    Fail = error => Debug.LogError($"Payment failed: {error.ErrMsg}"),
    Complete = () => Debug.Log("Payment flow completed")
});

TT.NavigateToBalance(param)

Opens the balance management page where the user can view and manage their coin balance.

Signature

public static void NavigateToBalance(NavigateToBalanceParam param)

Parameters

Field

Type

Description

Required

Success

Action

Success callback

No

Fail

Action<ErrorInfo>

Failure callback

No

Complete

Action

Completion callback

No

Example

TT.NavigateToBalance(new NavigateToBalanceParam
{
    Success = () => Debug.Log("Balance page opened"),
    Fail = error => Debug.LogError(error.ErrMsg),
    Complete = () => Debug.Log("Navigation completed")
});

TT.CheckBalance(param)

Queries the user's current coin balance.

Signature

public static void CheckBalance(CheckBalanceParam param)

Parameters

Field

Type

Description

Required

Success

Action<CheckBalanceResult>

Success callback with balance info

No

Fail

Action<ErrorInfo>

Failure callback

No

Complete

Action

Completion callback

No

Example

TT.CheckBalance(new CheckBalanceParam
{
    Success = result => Debug.Log($"Balance: {result.balance}"),
    Fail = error => Debug.LogError(error.ErrMsg),
    Complete = () => Debug.Log("Balance check completed")
});

TT.Recharge(param)

Initiates a coin recharge flow. The player will see a recharge dialog for the specified amount.

Signature

public static void Recharge(RechargeParam param)

Parameters

Field

Type

Description

Required

mode

string

Recharge mode

Yes

env

int

Environment (0 for production, 1 for sandbox)

Yes

currency

string

Currency type

No

platform

string

Payment platform

No

buyQuantity

int

Quantity to recharge

No

zoneId

string

Zone ID

No

customId

string

Custom order ID

No

extraInfo

string

Additional order info in JSON

No

Success

Action<RechargeResult>

Success callback

No

Fail

Action<ErrorInfo>

Failure callback

No

Complete

Action

Completion callback

No

Example

TT.Recharge(new RechargeParam
{
    mode = "gamecoin",
    env = 0,
    currency = "diamond",
    platform = "android",
    buyQuantity = 50,
    Success = result => Debug.Log("Recharge succeeded"),
    Fail = error => Debug.LogError(error.ErrMsg),
    Complete = () => Debug.Log("Recharge flow completed")
});
TikTok for Developers