telegram api method · layer 229 · #6dfa0622
payments.botCancelStarsSubscription
Cancel a bot subscription
definition
payments.botCancelStarsSubscription#6dfa0622 flags:# restore:flags.0?true user_id:InputUser charge_id:string = Bool;
parameters
| name | type | description |
|---|---|---|
flags | # | Flags, see TL conditional fields |
restore | true | If not set, disables autorenewal of the subscriptions, and prevents the user from reactivating the subscription once the current period expires: a subscription cancelled by the bot will have the starsSubscription.bot_canceled flag set. The bot can can partially undo this operation by setting this flag: this will allow the user to reactivate the subscription. |
user_id | InputUser | The ID of the user whose subscription should be (un)cancelled |
charge_id | string | The provider_charge_id from the messageActionPaymentSentMe service message sent to the bot for the first subscription payment. |
returns
errors (4)
| code | error | description |
|---|---|---|
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we're a user, and users cannot invoke methods over a business connection; (2) we're a bot, but business mode was disabled in @botfather or (3); we're a bot, but this method cannot be invoked over a business connection. |
| 400 | CHARGE_ID_INVALID | The specified charge_id is invalid. |
| 400 | USER_ID_INVALID | The provided user ID is invalid. |
| 401 | AUTH_KEY_UNREGISTERED | The specified authorization key is not registered in the system (for example, a PFS temporary key has expired). |
history
present in layers 193–229 · constructor id changed 1×
| id | layers |
|---|---|
| #57f9ece6 | 193 |
| #6dfa0622 | 194–229 |