Link Search Menu Expand Document

Constructor: starRefProgram

Back to constructors index

Indo about an affiliate program offered by a bot

Attributes:

NameTypeRequiredDescription
bot_idlongYesID of the bot that offers the program
commission_permilleintYesAn affiliate gets a commission of starRefProgram.commission_permilleTelegram Stars for every mini app transaction made by users they refer
duration_monthsintOptionalAn affiliate gets a commission for every mini app transaction made by users they refer, for duration_months months after a referral link is imported, starting the bot for the first time
end_dateintOptionalPoint in time (Unix timestamp) when the affiliate program will be closed (optional, if not set the affiliate program isn’t scheduled to be closed)
daily_revenue_per_userStarsAmountOptionalThe amount of daily revenue per user in Telegram Stars of the bot that created the affiliate program.
To obtain the approximated revenue per referred user, multiply this value by commission_permille and divide by 1000.

Type: StarRefProgram

Example:

$starRefProgram = ['_' => 'starRefProgram', 'bot_id' => long, 'commission_permille' => int, 'duration_months' => int, 'end_date' => int, 'daily_revenue_per_user' => StarsAmount];