Skip to content

transferBusinessAccountStars

Returns: TrueOfficial docs ↗

Transfers Telegram Stars from the business account balance to the bot's balance. Requires the can_transfer_stars business bot right. Returns True on success.

Parameters

business_connection_idStringRequired
Unique identifier of the business connection
star_countIntegerRequired
Number of Telegram Stars to transfer; 1-10000

Returns

On success, True is returned.

GramIO Usage

ts
// Transfer 100 Stars from a connected business account to the bot
await 
bot
.
api
.
transferBusinessAccountStars
({
business_connection_id
: "BIZCONN_abc123",
star_count
: 100,
});
ts
// Transfer the maximum allowed amount in one call (10,000 Stars)
await 
bot
.
api
.
transferBusinessAccountStars
({
business_connection_id
: "BIZCONN_abc123",
star_count
: 10000,
});
ts
// Check balance before transferring, then transfer
const 
balance
= await
bot
.
api
.
getBusinessAccountStarBalance
({
business_connection_id
: "BIZCONN_abc123",
}); if (
balance
.
amount
>= 500) {
await
bot
.
api
.
transferBusinessAccountStars
({
business_connection_id
: "BIZCONN_abc123",
star_count
: 500,
});
console
.
log
("Transferred 500 Stars to bot balance");
}

Errors

CodeErrorCause
400Bad Request: business connection not foundThe business_connection_id is invalid or the business account has disconnected from the bot
400Bad Request: not enough rightsThe bot doesn't have the can_transfer_stars business right — the business account owner must grant this permission
400Bad Request: not enough starsThe business account balance is lower than star_count — check balance with getBusinessAccountStarBalance first
400Bad Request: STAR_COUNT_INVALIDstar_count is 0 or exceeds 10,000 — must be between 1 and 10,000 inclusive
429Too Many Requests: retry after NRate limit hit — check retry_after, use auto-retry plugin

TIP

Use GramIO's auto-retry plugin to handle 429 errors automatically.

Tips & Gotchas

  • Requires can_transfer_stars business bot right. The business account owner must explicitly grant this permission when connecting the bot. Without it, every call returns an authorization error.
  • 1–10,000 Stars per call. For large transfers, you'll need multiple calls. There's no bulk-transfer API — plan for rate limits between calls.
  • Check balance before transferring. Use getBusinessAccountStarBalance to verify sufficient funds before calling — attempting to transfer more Stars than available returns an error.
  • Stars move to the bot's balance, not the bot owner's wallet. Transferred Stars become part of the bot's own balance and can be used for bot-related payments or withdrawals through the bot's settings.
  • This is a Business API feature. transferBusinessAccountStars is only available for bots connected to a Telegram Business account. The business_connection_id is provided in business-related updates.

See Also