Referral System in a Telegram Bot
How to create a bot with a referral program: detailed lessons and special features
The referral system for working with a MAX bot is fully identical.
Changes as of 14.04.2026
The word "Telegram" was removed from the names of all referral system methods. For example: was {{ getTelegramInviteLink() }} → became {{ getInviteLink() }}.
For cross-platform bot compatibility, we recommend switching to the new method names.
You can:
- work with any level of referrers and referrals in real time
- change the referrer even if the current contact has their own referrals
1. {{ getInviteLink() }} - Contact's referral link in a Telegram bot
If you place {{ getInviteLink() }} in a text field, the bot will generate a link in the format: https://app.leadteh.ru/u/hcjn with the Leadteh domain
If you place {{ getDirectInviteLink() }} in a text field, the bot will generate a link in the format: https://telegram.me/LeadTex_bot?start=dvnka214-aa79-44f8-gj88-efg9e3371608without the Leadteh domain
2. {{ getReferrals() }} - Get a list of the contact's first-level referrals (last 100)
Get the first 10 referrals: {{ getReferrals(10) }}\ Get the first 20 referrals with the "Purchased" tag: {{ getReferrals(20, "Purchased") }}
Works in real time
3. {{ getReferralsCount() }} - Get the number of referrals in the contact's entire network (all levels).
Get the number of referrals with the "Purchased" tag: {{ getReferralsCount("Purchased") }}
Works in real time
4. {{ getReferrer() }} - Get your referrer
- works in real time
- no limit on the number of lines for getting a referrer
5. {{ getLinkBySchema(123) }} , where 123 is the scenario id - Get a link to the scenario
{{ getInviteLinkWithSchema(123) }} , where 123 is the scenario id - Get a referral link to an additional scenario
Note: If a link to an additional scenario was not created earlier in Channels -> Telegram -> Direct links to additional scenarios, it is created automatically
7. {{ getReferralsByDepth() }} , – get a list of referrals at the specified level
Output first-level referrals {{ getReferralsByDepth(1) }}
Output 10 first-level referrals {{ getReferralsByDepth(1, 10) }}
- works in real time
- no limit on the number of lines for getting referrals; you can get referrals even at the 100th level
- you can get referrals at any line with a specific tag, for example:
{{ getReferralsByDepth(100, 10, "TagName") }}
8. {{ getReferralsCountByDepth() }} – get the number of referrals at the specified level
{{ getReferralsCountByDepth(20) }}– get the number of referrals at level 20{{ getReferralsCountByDepth(5, "Purchased") }}- get the number of referrals at level 5 who have the "Purchased" tag
9. {{ getReferrers(10) }} - output 10 referrers
10. {{ getReferrers(10, 0, "purchased") }} - output 10 referrers with the purchased tag
11. {{ getReferrers(10, 5, "purchased") }} - output 10 referrers with the purchased tag starting from level 5
We developed an unlimited referral system — how many levels to choose in the referral program is up to you! For this, we created a special API for getting referral information — https://leadtex.gitbook.io/leadtex-api/rabota-s-api/kontakty/referalnaya-sistema
Using the getCountReferrals API method, you can specify the line (level parameter) along which to count referrals.
LEADTEX referral system in a Telegram bot with automatic bonus crediting
Creating a referral system in a chat bot with invite link generation, automatic bonus crediting for referrals, and multi-level reward structure setup without programming.
LEADTEX referral system tools — blocks, conditions, autoresponders
Overview of the main tools for working with referrals: invite link types, condition blocks for checking referrals, autoresponder setup, and API integration for advanced capabilities.
Automatic bonus crediting for referrals in a Telegram bot
Setting up a bonus crediting system for new referrals with tracking of already paid invitations. Manual and automatic reward crediting modes in the referral program.
"Credit reward to referrer" block — 10 referral levels and cashback
Overview of the block for creating a multi-level referral system up to 10 levels with automatic cashback, payment system integration, and flexible reward settings.
Bonus for new users: get 500 rubles in credits as a gift 🎁
- Sign up on LEADTEX
- Create and test your first project
- Don't miss the special offer. Get your gift 👈
.png)