Layer 220
PaymentsGetStarsRevenueWithdrawalUrl
Withdraw funds from a channel or bot's star balance.
method
Users
payments.getStarsRevenueWithdrawalUrl#2433dc92 flags:# ton:flags.0?true peer:InputPeer amount:flags.1?long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
Parameters
| Name | Type | Description |
|---|---|---|
| Flags | # | Flags, see TL conditional fields |
| Ton | flags.0?true | If set, withdraws channel/ad revenue in TON. |
| Peer | InputPeer | Channel or bot from which to withdraw funds. |
| Amount | flags.1?long | The amount of stars or nanotons to withdraw. |
| Password | InputCheckPasswordSRP | 2 FA password, see here for more info. |
Possible Errors
| Code | Type | Description |
|---|---|---|
| 400 | PASSWORD_HASH_INVALID | The provided password hash is invalid. |
| 400 | PASSWORD_MISSING | You must enable 2 FA before executing this operation. |
| 400 | PASSWORD_TOO_FRESH_%d | The password was modified less than 24 hours ago, try again in <number> seconds. |
| 400 | SESSION_TOO_FRESH_%d | This session was created less than 24 hours ago, try again in <number> seconds. |
Gogram Example
// PaymentsGetStarsRevenueWithdrawalUrl - using Params struct result, err := client.PaymentsGetStarsRevenueWithdrawalUrl(&tg.PaymentsGetStarsRevenueWithdrawalUrlParams{ Peer: &tg.InputPeerUser{UserID: int64(123456789)}, Password: &tg.InputCheckPasswordSrp{}, // Optional fields: // Ton: true, // Amount: int64(0), }) if err != nil { // handle error } // result is *tg.PaymentsStarsRevenueWithdrawalUrl