telegram api method · layer 229 · #778b5ab3

bots.updateStarRefProgram

usable by users

Create, edit or delete the affiliate program of a bot we own

definition

bots.updateStarRefProgram#778b5ab3 flags:# bot:InputUser commission_permille:int duration_months:flags.0?int = StarRefProgram;

parameters

nametypedescription
flags#Flags, see TL conditional fields
botInputUserThe bot
commission_permilleintThe permille commission rate: it indicates the share of Telegram Stars received by affiliates for every transaction made by users they referred inside of the bot. The minimum and maximum values for this parameter are contained in the starref_min_commission_permille and starref_max_commission_permille client configuration parameters. Can be 0 to terminate the affiliate program. Both the duration and the commission may only be raised after creation of the program: to lower them, the program must first be terminated and a new one created.
duration_monthsflags.0?intIndicates the duration of the affiliate program; if not set, there is no expiration date.

returns

StarRefProgram

errors (6)

codeerrordescription
400BOT_INVALIDThis is not a valid bot.
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.
400STARREF_AWAITING_ENDThe previous referral program was terminated less than 24 hours ago: further changes can be made after the date specified in userFull.starref_program.end_date.
400STARREF_PERMILLE_INVALIDThe specified commission_permille is invalid: the minimum and maximum values for this parameter are contained in the starref_min_commission_permille and starref_max_commission_permille client configuration parameters.
400STARREF_PERMILLE_TOO_LOWThe specified commission_permille is too low: the minimum and maximum values for this parameter are contained in the starref_min_commission_permille and starref_max_commission_permille client configuration parameters.
401AUTH_KEY_UNREGISTEREDThe specified authorization key is not registered in the system (for example, a PFS temporary key has expired).

history

present in layers 195–229

idlayers
#778b5ab3195–229