telegram api method · layer 229 · #6dfa0622

payments.botCancelStarsSubscription

usable by users

Cancel a bot subscription

definition

payments.botCancelStarsSubscription#6dfa0622 flags:# restore:flags.0?true user_id:InputUser charge_id:string = Bool;

parameters

nametypedescription
flags#Flags, see TL conditional fields
restoreflags.0?trueIf 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_idInputUserThe ID of the user whose subscription should be (un)cancelled
charge_idstringThe provider_charge_id from the messageActionPaymentSentMe service message sent to the bot for the first subscription payment.

returns

Bool

errors (4)

codeerrordescription
400BUSINESS_CONNECTION_NOT_ALLOWEDThis 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.
400CHARGE_ID_INVALIDThe specified charge_id is invalid.
400USER_ID_INVALIDThe provided user ID is invalid.
401AUTH_KEY_UNREGISTEREDThe 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×

idlayers
#57f9ece6193
#6dfa0622194–229