TikTok for Developers

Developer Docs

Last updated October 1, 2026

In-App Purchases

Manages in-game currency operations including balance checks, top-ups, payments, and navigation to the balance page, enabling monetization through TikTok Beans.

TTMinis.game.checkBalance(opts)

Warning: Deprecated. Use TTMinis.game.pay instead.

Checks whether the current Beans balance is sufficient.

Parameters

Field

Type

Description

Required

amount

int32

The amount to check

Yes

type

string

The currency type. Currently only BEANS is supported.

Yes

success

function

The callback function called when the API call succeeds

No

fail

function

The callback function called when the API call fails

No

complete

function

The callback function called when the API call ends, regardless of success or failure

No

Success callback parameters

Field

Type

Description

is_sufficient

Boolean

Whether the balance is sufficient for the requested amount

Example

TTMinis.game.checkBalance({
  amount: 50,
  type: 'BEANS',
  success: (result) => {
    let isSufficient = result.is_sufficient;
  },
  fail: (error) => {
    // Handle error
  },
  complete: () => {
    // Triggered for both success and failure
  }
})

TTMinis.game.recharge(opts)

Warning: Deprecated. Use TTMinis.game.pay instead.

Recharges Beans.

Parameters

Field

Type

Description

Required

tier_id

string

The recharge tier ID

Yes

success

function

The callback function called when the API call succeeds

No

fail

function

The callback function called when the API call fails

No

complete

function

The callback function called when the API call ends, regardless of success or failure

No

Example

TTMinis.game.recharge({
  tier_id: 'YOUR_TIER_ID',
  success: () => {
    // Handle success
  },
  fail: (error) => {
    // Handle error
  },
  complete: () => {
    // Triggered for both success and failure
  }
})

TTMinis.game.pay(opts)

Initiates a payment.

Parameters

Field

Type

Description

Required

trade_order_id

string

The payment order ID

Yes

success

function

The callback function called when the API call succeeds

No

fail

function

The callback function called when the API call fails

No

complete

function

The callback function called when the API call ends, regardless of success or failure

No

Example

TTMinis.game.pay({
  trade_order_id: 'YOUR_TRADE_ORDER_ID',
  success: () => {
    // Handle success
  },
  fail: (error) => {
    // Handle error
  },
  complete: () => {
    // Triggered for both success and failure
  }
})

TTMinis.game.navigateToBalance(opts)

Navigates to the TikTok user Balance details page.

Parameters

Field

Type

Description

Required

type

string

The currency type. Currently only BEANS is supported.

Yes

success

function

The callback function called when the API call succeeds

No

fail

function

The callback function called when the API call fails

No

complete

function

The callback function called when the API call ends, regardless of success or failure

No

Example

TTMinis.game.navigateToBalance({
  type: 'BEANS',
  success: () => {
    // Handle success
  },
  fail: (error) => {
    // Handle error
  },
  complete: () => {
    // Triggered for both success and failure
  }
})

Error codes

errorCode

subErrorCode

Description

13000


Environment check failed: App Store or Google Play connection failed

13001


Environment check failed: Timeout

13002


Environment check failed: Device not supported

13003


Environment check failed: Device not supported

13013


IAP payment: Failed

13014


Order consumption query: Server returned incorrect order status

30001


IAP payment: Canceled

30002


IAP payment: Pending

30003


User closed the payment panel

30004


User tapped the product repeatedly; the third party called the JSB multiple times

20000


Network error


20012

Order consumption query: API network failure


20013

Balance check: API network failure


20014

Recommended tier retrieval: API network failure


20015

Beans consumption: API network failure


20021

Subscription list query: API network failure


20022

Subscription cancellation: API network failure

50000


System error


50001

Tier info error


50002

Failed to open the payment panel


50004

Order query timeout


50007

Server returned an incorrect status code

Other


Server-side error

TikTok for Developers