mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-11 17:31:02 +01:00
243 lines
26 KiB
HTML
243 lines
26 KiB
HTML
<!DOCTYPE html>
|
||
<html class="">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>Telegram Stars</title>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta property="description" content="Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.">
|
||
<meta property="og:title" content="Telegram Stars">
|
||
<meta property="og:image" content="">
|
||
<meta property="og:description" content="Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more.">
|
||
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
|
||
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
|
||
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
|
||
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
|
||
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
|
||
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
|
||
|
||
<link href="/css/telegram.css?241" rel="stylesheet" media="screen">
|
||
<style>
|
||
</style>
|
||
</head>
|
||
<body class="preload">
|
||
<div class="dev_page_wrap">
|
||
<div class="dev_page_head navbar navbar-static-top navbar-tg">
|
||
<div class="navbar-inner">
|
||
<div class="container clearfix">
|
||
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
|
||
<ul class="nav navbar-nav">
|
||
<li><a href="//telegram.org/">Home</a></li>
|
||
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
|
||
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
|
||
<li class="active"><a href="/api">API</a></li>
|
||
<li class=""><a href="/mtproto">Protocol</a></li>
|
||
<li class=""><a href="/schema">Schema</a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="container clearfix">
|
||
<div class="dev_page">
|
||
<div id="dev_page_content_wrap" class=" ">
|
||
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/stars" >Telegram Stars</a></li></ul></div>
|
||
<h1 id="dev_page_title">Telegram Stars</h1>
|
||
|
||
<div id="dev_page_content"><!-- scroll_nav -->
|
||
|
||
<p>Telegram Stars are virtual items that allow users to purchase digital goods and services from bots and mini apps inside the Telegram ecosystem, send gifts to content creators on the Telegram platform, and more. </p>
|
||
<p>This page describes the methods used to buy, use and withdraw <a href="https://telegram.org/blog/mini-app-bar-paid-media-and-more#rewards-for-content-creators-and-developers">Telegram Stars</a>, as well as view detailed revenue stats and make purchases using Telegram Stars. </p>
|
||
<p>Clients should disable Telegram Stars support for the current user if the <a href="/api/config#stars-purchase-blocked">stars_purchase_blocked field is equal to <code>true</code> »</a> due to regional limitations. </p>
|
||
<h3><a class="anchor" href="#balance-and-transaction-history" id="balance-and-transaction-history" name="balance-and-transaction-history"><i class="anchor-icon"></i></a>Balance and transaction history</h3>
|
||
<pre><code><a href='/constructor/inputStarsTransaction'>inputStarsTransaction</a>#206ae6d1 flags:<a href='/type/%23'>#</a> refund:flags.0?<a href='/constructor/true'>true</a> id:<a href='/type/string'>string</a> = <a href='/type/InputStarsTransaction'>InputStarsTransaction</a>;
|
||
|
||
<a href='/constructor/starsTransactionPeerAppStore'>starsTransactionPeerAppStore</a>#b457b375 = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||
<a href='/constructor/starsTransactionPeerPlayMarket'>starsTransactionPeerPlayMarket</a>#7b560a0b = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||
<a href='/constructor/starsTransactionPeerPremiumBot'>starsTransactionPeerPremiumBot</a>#250dbaf8 = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||
<a href='/constructor/starsTransactionPeerFragment'>starsTransactionPeerFragment</a>#e92fd902 = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||
<a href='/constructor/starsTransactionPeer'>starsTransactionPeer</a>#d80da15d peer:<a href='/type/Peer'>Peer</a> = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||
<a href='/constructor/starsTransactionPeerAds'>starsTransactionPeerAds</a>#60682812 = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||
<a href='/constructor/starsTransactionPeerUnsupported'>starsTransactionPeerUnsupported</a>#95f2bfe4 = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||
|
||
<a href='/constructor/starsTransaction'>starsTransaction</a>#2db5418f flags:<a href='/type/%23'>#</a> refund:flags.3?<a href='/constructor/true'>true</a> pending:flags.4?<a href='/constructor/true'>true</a> failed:flags.6?<a href='/constructor/true'>true</a> gift:flags.10?<a href='/constructor/true'>true</a> id:<a href='/type/string'>string</a> stars:<a href='/type/long'>long</a> date:<a href='/type/int'>int</a> peer:<a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a> title:flags.0?<a href='/type/string'>string</a> description:flags.1?<a href='/type/string'>string</a> photo:flags.2?<a href='/type/WebDocument'>WebDocument</a> transaction_date:flags.5?<a href='/type/int'>int</a> transaction_url:flags.5?<a href='/type/string'>string</a> bot_payload:flags.7?<a href='/type/bytes'>bytes</a> msg_id:flags.8?<a href='/type/int'>int</a> extended_media:flags.9?<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessageMedia'>MessageMedia</a>> = <a href='/type/StarsTransaction'>StarsTransaction</a>;
|
||
|
||
<a href='/constructor/payments.starsStatus'>payments.starsStatus</a>#8cf4ee60 flags:<a href='/type/%23'>#</a> balance:<a href='/type/long'>long</a> history:<a href='/type/Vector%20t'>Vector</a><<a href='/type/StarsTransaction'>StarsTransaction</a>> next_offset:flags.0?<a href='/type/string'>string</a> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/payments.StarsStatus'>payments.StarsStatus</a>;
|
||
|
||
<a href='/constructor/updateStarsBalance'>updateStarsBalance</a>#0fb85198 balance:<a href='/type/long'>long</a> = <a href='/type/Update'>Update</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/payments.getStarsStatus'>payments.getStarsStatus</a>#104fcfa7 peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/payments.StarsStatus'>payments.StarsStatus</a>;
|
||
|
||
<a href='/method/payments.getStarsTransactions'>payments.getStarsTransactions</a>#97938d5a flags:<a href='/type/%23'>#</a> inbound:flags.0?<a href='/constructor/true'>true</a> outbound:flags.1?<a href='/constructor/true'>true</a> ascending:flags.2?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> offset:<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/payments.StarsStatus'>payments.StarsStatus</a>;
|
||
|
||
<a href='/method/payments.getStarsTransactionsByID'>payments.getStarsTransactionsByID</a>#27842d2e peer:<a href='/type/InputPeer'>InputPeer</a> id:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputStarsTransaction'>InputStarsTransaction</a>> = <a href='/type/payments.StarsStatus'>payments.StarsStatus</a>;</code></pre>
|
||
<p>Use <a href="/method/payments.getStarsStatus">payments.getStarsStatus</a> to get the current stars balance of the current account (with peer=<a href="/constructor/inputPeerSelf">inputPeerSelf</a>), or the stars balance of the bot or channel specified in <code>peer</code>.<br>
|
||
The method will also return the last 5 <a href="/constructor/starsTransaction">star transactions »</a>.<br>
|
||
To return all <a href="/constructor/starsTransaction">star transactions »</a> (and optionally search using filters), use <a href="/method/payments.getStarsTransactions">payments.getStarsTransactions</a>, paginating through the transactions passing the returned <code>next_offset</code> (if set) to <code>offset</code> <a href="/api/offsets">as usual</a>. </p>
|
||
<p><a href="/method/payments.getStarsTransactionsByID">payments.getStarsTransactionsByID</a> may be used to fetch info about specific Telegram Star transactions (or refunds) using their IDs, passed as <a href="/constructor/inputStarsTransaction">inputStarsTransaction</a> constructors. </p>
|
||
<p>Changes in the star balance (through <a href="#buying-or-gifting-stars">topups</a> or <a href="#using-stars">purchases</a>) will be notified by the server via an <a href="/constructor/updateStarsBalance">updateStarsBalance</a> update.</p>
|
||
<h3><a class="anchor" href="#revenue-statistics" id="revenue-statistics" name="revenue-statistics"><i class="anchor-icon"></i></a>Revenue statistics</h3>
|
||
<pre><code><a href='/constructor/starsRevenueStatus'>starsRevenueStatus</a>#79342946 flags:<a href='/type/%23'>#</a> withdrawal_enabled:flags.0?<a href='/constructor/true'>true</a> current_balance:<a href='/type/long'>long</a> available_balance:<a href='/type/long'>long</a> overall_revenue:<a href='/type/long'>long</a> next_withdrawal_at:flags.1?<a href='/type/int'>int</a> = <a href='/type/StarsRevenueStatus'>StarsRevenueStatus</a>;
|
||
|
||
<a href='/constructor/payments.starsRevenueStats'>payments.starsRevenueStats</a>#c92bb73b revenue_graph:<a href='/type/StatsGraph'>StatsGraph</a> status:<a href='/type/StarsRevenueStatus'>StarsRevenueStatus</a> usd_rate:<a href='/type/double'>double</a> = <a href='/type/payments.StarsRevenueStats'>payments.StarsRevenueStats</a>;
|
||
|
||
<a href='/constructor/updateStarsRevenueStatus'>updateStarsRevenueStatus</a>#a584b019 peer:<a href='/type/Peer'>Peer</a> status:<a href='/type/StarsRevenueStatus'>StarsRevenueStatus</a> = <a href='/type/Update'>Update</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/payments.getStarsRevenueStats'>payments.getStarsRevenueStats</a>#d91ffad6 flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/payments.StarsRevenueStats'>payments.StarsRevenueStats</a>;</code></pre>
|
||
<p>Telegram Star revenue statistics may be fetched by bot owners, and by channel admins if the <a href="/constructor/channelFull">channelFull</a>.<code>can_view_stars_revenue</code> flag is set. </p>
|
||
<p>Use <a href="/method/payments.getStarsRevenueStats">payments.getStarsRevenueStats</a> to fetch statistics about earned Telegram Stars; the returned <a href="/type/StatsGraph">StatsGraph</a> graphs can be rendered <a href="/api/stats#graph-visualization">as described here »</a>. </p>
|
||
<p>Specifically:</p>
|
||
<ul>
|
||
<li><code>revenue_graph</code> - Star revenue graph (number of earned stars)</li>
|
||
<li><code>status</code> - Current balance, current withdrawable balance and overall earned Telegram Stars</li>
|
||
<li><code>usd_rate</code> - Current conversion rate of Telegram Stars to USD</li>
|
||
</ul>
|
||
<p>The server will emit an <a href="/constructor/updateStarsRevenueStatus">updateStarsRevenueStatus</a> every time the balance changes; if the client is currently in the Monetization tab of the channel or bot, this update should apply the new balances (contained in the update), and refresh the transaction list using <a href="/method/payments.getStarsTransactions">payments.getStarsTransactions</a> as specified <a href="#balance-and-transaction-history">here »</a>. </p>
|
||
<h3><a class="anchor" href="#buying-or-gifting-stars" id="buying-or-gifting-stars" name="buying-or-gifting-stars"><i class="anchor-icon"></i></a>Buying or gifting stars</h3>
|
||
<pre><code><a href='/constructor/starsTopupOption'>starsTopupOption</a>#bd915c0 flags:<a href='/type/%23'>#</a> extended:flags.1?<a href='/constructor/true'>true</a> stars:<a href='/type/long'>long</a> store_product:flags.0?<a href='/type/string'>string</a> currency:<a href='/type/string'>string</a> amount:<a href='/type/long'>long</a> = <a href='/type/StarsTopupOption'>StarsTopupOption</a>;
|
||
|
||
<a href='/constructor/starsGiftOption'>starsGiftOption</a>#5e0589f1 flags:<a href='/type/%23'>#</a> extended:flags.1?<a href='/constructor/true'>true</a> stars:<a href='/type/long'>long</a> store_product:flags.0?<a href='/type/string'>string</a> currency:<a href='/type/string'>string</a> amount:<a href='/type/long'>long</a> = <a href='/type/StarsGiftOption'>StarsGiftOption</a>;
|
||
|
||
<a href='/constructor/inputStorePaymentStarsTopup'>inputStorePaymentStarsTopup</a>#dddd0f56 stars:<a href='/type/long'>long</a> currency:<a href='/type/string'>string</a> amount:<a href='/type/long'>long</a> = <a href='/type/InputStorePaymentPurpose'>InputStorePaymentPurpose</a>;
|
||
<a href='/constructor/inputStorePaymentStarsGift'>inputStorePaymentStarsGift</a>#1d741ef7 user_id:<a href='/type/InputUser'>InputUser</a> stars:<a href='/type/long'>long</a> currency:<a href='/type/string'>string</a> amount:<a href='/type/long'>long</a> = <a href='/type/InputStorePaymentPurpose'>InputStorePaymentPurpose</a>;
|
||
|
||
<a href='/constructor/inputInvoiceStars'>inputInvoiceStars</a>#65f00ce3 purpose:<a href='/type/InputStorePaymentPurpose'>InputStorePaymentPurpose</a> = <a href='/type/InputInvoice'>InputInvoice</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/payments.getStarsTopupOptions'>payments.getStarsTopupOptions</a>#c00ec7d3 = <a href='/type/Vector%20t'>Vector</a><<a href='/type/StarsTopupOption'>StarsTopupOption</a>>;
|
||
|
||
<a href='/method/payments.getStarsGiftOptions'>payments.getStarsGiftOptions</a>#d3c96bc8 flags:<a href='/type/%23'>#</a> user_id:flags.0?<a href='/type/InputUser'>InputUser</a> = <a href='/type/Vector%20t'>Vector</a><<a href='/type/StarsGiftOption'>StarsGiftOption</a>>;</code></pre>
|
||
<p>To purchase telegram stars for ourselves, first invoke the <a href="/method/payments.getStarsTopupOptions">payments.getStarsTopupOptions</a> method, to obtain a list of topup options as <a href="/constructor/starsTopupOption">starsTopupOption</a> constructors. </p>
|
||
<p>To purchase telegram stars for a friend, first invoke the <a href="/method/payments.getStarsGiftOptions">payments.getStarsGiftOptions</a> method, to obtain a list of gift options as <a href="/constructor/starsGiftOption">starsGiftOption</a> constructors. </p>
|
||
<p><strong>Note</strong>: Star gifting functionality should only be enabled if the <a href="/api/config#stars-gifts-enabled">stars_gifts_enabled »</a> flag is equal to true. </p>
|
||
<p>Once the user has chosen a specific star topup/gift option, invoke <a href="/method/payments.getPaymentForm">payments.getPaymentForm</a>, passing an <a href="/constructor/inputInvoiceStars">inputInvoiceStars</a>, with either <a href="/constructor/inputStorePaymentStarsTopup">inputStorePaymentStarsTopup</a> or <a href="/constructor/inputStorePaymentStarsGift">inputStorePaymentStarsGift</a>, populated with the values from the chosen <a href="/constructor/starsTopupOption">starsTopupOption</a>/<a href="/constructor/starsGiftOption">starsGiftOption</a>.</p>
|
||
<p>Then, follow the <a href="/api/payments#22-getting-invoice-info-about-the-product">invoice payment flow as described in the payments documentation »</a>. </p>
|
||
<p>More alternative payment flows are also available:</p>
|
||
<ul>
|
||
<li>Payment via <a href="https://fragment.com">Fragment</a>, which also allows making larger purchases.</li>
|
||
<li>The store-based subscription flow based on <a href="/method/payments.assignAppStoreTransaction">payments.assignAppStoreTransaction</a>/<a href="/method/payments.assignPlayMarketTransaction">payments.assignPlayMarketTransaction</a>, currently not available to third-party apps. </li>
|
||
</ul>
|
||
<p>For gifts, once the payment is successfully processed, the user to which the gift was sent will automatically receive a <a href="/constructor/messageService">messageService</a> from the user that sent the gift, containing a <a href="/constructor/messageActionGiftStars">messageActionGiftStars</a> constructor with further info about the price and duration of the gifted Telegram Stars.<br>
|
||
Clients should display this message, along with a sticker from the <a href="/constructor/inputStickerSetPremiumGifts">inputStickerSetPremiumGifts</a> <a href="/api/stickers">stickerset</a>: here's an <a href="https://telegram.org/blog/w3-browser-mini-app-store#gifting-stars-to-friends">example</a>. </p>
|
||
<h3><a class="anchor" href="#using-stars" id="using-stars" name="using-stars"><i class="anchor-icon"></i></a>Using stars</h3>
|
||
<pre><code><a href='/constructor/payments.paymentFormStars'>payments.paymentFormStars</a>#7bf6b15c flags:<a href='/type/%23'>#</a> form_id:<a href='/type/long'>long</a> bot_id:<a href='/type/long'>long</a> title:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> photo:flags.5?<a href='/type/WebDocument'>WebDocument</a> invoice:<a href='/type/Invoice'>Invoice</a> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/payments.PaymentForm'>payments.PaymentForm</a>;
|
||
|
||
<a href='/constructor/payments.paymentReceiptStars'>payments.paymentReceiptStars</a>#dabbf83a flags:<a href='/type/%23'>#</a> date:<a href='/type/int'>int</a> bot_id:<a href='/type/long'>long</a> title:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> photo:flags.2?<a href='/type/WebDocument'>WebDocument</a> invoice:<a href='/type/Invoice'>Invoice</a> currency:<a href='/type/string'>string</a> total_amount:<a href='/type/long'>long</a> transaction_id:<a href='/type/string'>string</a> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/payments.PaymentReceipt'>payments.PaymentReceipt</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/payments.sendStarsForm'>payments.sendStarsForm</a>#02bb731d flags:<a href='/type/%23'>#</a> form_id:<a href='/type/long'>long</a> invoice:<a href='/type/InputInvoice'>InputInvoice</a> = <a href='/type/payments.PaymentResult'>payments.PaymentResult</a>;
|
||
|
||
<a href='/method/payments.refundStarsCharge'>payments.refundStarsCharge</a>#25ae8f4a user_id:<a href='/type/InputUser'>InputUser</a> charge_id:<a href='/type/string'>string</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
||
<p>The full flow to follow to make purchases using Telegram Stars is described along the traditional payment flow in the <a href="/api/payments">payments documentation »</a>: all invoices and constructors working with currency amounts will use the currency code <code>XTR</code>, and the amounts will be in Telegram Stars. </p>
|
||
<h4><a class="anchor" href="#paid-media" id="paid-media" name="paid-media"><i class="anchor-icon"></i></a>Paid media</h4>
|
||
<p>Telegram Stars are used to pay for <a href="/api/paid-media">paid media</a>, which may be posted on channels by administrators as specified <a href="/api/paid-media">here »</a>. </p>
|
||
<p>Purchasing paid media will transfer Telegram Stars to the channel's balance.<br>
|
||
Channel owners can then <a href="#withdrawing-revenue">withdraw Stars as Toncoin »</a>, or <a href="#paying-for-ads">use Stars to place ads for the channel »</a>. </p>
|
||
<p><a href="#revenue-statistics">Star revenue statistics</a> and <a href="#balance-and-transaction-history">balance information</a> is also available to channel owners. </p>
|
||
<h4><a class="anchor" href="#bot-payments" id="bot-payments" name="bot-payments"><i class="anchor-icon"></i></a>Bot payments</h4>
|
||
<p>Telegram Stars are also used to pay for digital services in bots, using <a href="/constructor/keyboardButtonBuy">keyboardButtonBuy</a> and <a href="/api/payments">the usual payment flow »</a>, with <code>currency="XTR"</code>. </p>
|
||
<p>Purchasing paid media will transfer Telegram Stars to the bot's balance.<br>
|
||
Bot owners can then <a href="#withdrawing-revenue">withdraw Stars as Toncoin »</a>, or <a href="#paying-for-ads">use Stars to place ads for the channel »</a>. </p>
|
||
<p><a href="#revenue-statistics">Star revenue statistics</a> and <a href="#balance-and-transaction-history">balance information</a> is also available to bot owners. </p>
|
||
<h3><a class="anchor" href="#withdrawing-revenue" id="withdrawing-revenue" name="withdrawing-revenue"><i class="anchor-icon"></i></a>Withdrawing revenue</h3>
|
||
<pre><code><a href='/constructor/payments.starsRevenueWithdrawalUrl'>payments.starsRevenueWithdrawalUrl</a>#1dab80b7 url:<a href='/type/string'>string</a> = <a href='/type/payments.StarsRevenueWithdrawalUrl'>payments.StarsRevenueWithdrawalUrl</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/payments.getStarsRevenueWithdrawalUrl'>payments.getStarsRevenueWithdrawalUrl</a>#13bbe8b3 peer:<a href='/type/InputPeer'>InputPeer</a> stars:<a href='/type/long'>long</a> password:<a href='/type/InputCheckPasswordSRP'>InputCheckPasswordSRP</a> = <a href='/type/payments.StarsRevenueWithdrawalUrl'>payments.StarsRevenueWithdrawalUrl</a>;</code></pre>
|
||
<p>To withdraw funds from the star balance of a channel or bot we own, invoke <a href="/method/payments.getStarsRevenueWithdrawalUrl">payments.getStarsRevenueWithdrawalUrl</a>, passing the current account's <a href="/api/srp">2FA password</a> as an <a href="/type/InputCheckPasswordSRP">InputCheckPasswordSRP</a> constructor, generated <a href="/api/srp">as specified here »</a>. </p>
|
||
<p>Only the channel/bot owner can invoke this method, and only if the balance is bigger than or equal to <a href="/api/config#stars-revenue-withdrawal-min">stars_revenue_withdrawal_min »</a> and the <code>status.withdrawal_enabled</code> flag returned by <a href="/method/payments.getStarsRevenueStats">payments.getStarsRevenueStats</a> is set. </p>
|
||
<p>The method will return a unique URL to a <a href="https://fragment.com/">Fragment</a> page where the user will be able to specify and submit the address of the TON wallet where the funds will be sent. </p>
|
||
<h3><a class="anchor" href="#paying-for-ads" id="paying-for-ads" name="paying-for-ads"><i class="anchor-icon"></i></a>Paying for ads</h3>
|
||
<pre><code><a href='/constructor/starsTransactionPeerAds'>starsTransactionPeerAds</a>#60682812 = <a href='/type/StarsTransactionPeer'>StarsTransactionPeer</a>;
|
||
|
||
<a href='/constructor/payments.starsRevenueAdsAccountUrl'>payments.starsRevenueAdsAccountUrl</a>#394e7f21 url:<a href='/type/string'>string</a> = <a href='/type/payments.StarsRevenueAdsAccountUrl'>payments.StarsRevenueAdsAccountUrl</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/payments.getStarsRevenueAdsAccountUrl'>payments.getStarsRevenueAdsAccountUrl</a>#d1d7efc5 peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/payments.StarsRevenueAdsAccountUrl'>payments.StarsRevenueAdsAccountUrl</a>;</code></pre>
|
||
<p>Channel/bot owners may place Telegram advertisements for channels/bots they own using the Telegram Ad platform, paying using the <strong>Stars</strong> currently available on the bot/channel's balance at a special rate with a <strong>30% discount</strong> – creating a <strong>cost-effective</strong> way of reaching new users. </p>
|
||
<p>To use Stars for ads, go to your bot's or channels' Balance or Monetization section and tap '<em>Buy Ads</em>'.<br>
|
||
Clicking on the button should invoke <a href="/method/payments.getStarsRevenueAdsAccountUrl">payments.getStarsRevenueAdsAccountUrl</a> (passing the bot/channel in <code>peer</code>).<br>
|
||
The returned <code>url</code> will lead to a page where the user will be able to place ads for the channel/bot passed in <code>peer</code>. </p>
|
||
<p><a href="#balance-and-transaction-history">Transactions</a> for ad payments will be of type <a href="/constructor/starsTransactionPeerAds">starsTransactionPeerAds</a>.</p></div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="footer_wrap">
|
||
<div class="footer_columns_wrap footer_desktop">
|
||
<div class="footer_column footer_column_telegram">
|
||
<h5>Telegram</h5>
|
||
<div class="footer_telegram_description"></div>
|
||
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
|
||
</div>
|
||
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/faq">About</a></h5>
|
||
<ul>
|
||
<li><a href="//telegram.org/faq">FAQ</a></li>
|
||
<li><a href="//telegram.org/privacy">Privacy</a></li>
|
||
<li><a href="//telegram.org/press">Press</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
|
||
<ul>
|
||
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
|
||
<li><a href="//telegram.org/android">Android</a></li>
|
||
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
|
||
<ul>
|
||
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
|
||
<li><a href="//macos.telegram.org/">macOS</a></li>
|
||
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer_column footer_column_platform">
|
||
<h5><a href="/">Platform</a></h5>
|
||
<ul>
|
||
<li><a href="/api">API</a></li>
|
||
<li><a href="//translations.telegram.org/">Translations</a></li>
|
||
<li><a href="//instantview.telegram.org/">Instant View</a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="footer_columns_wrap footer_mobile">
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/faq">About</a></h5>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/blog">Blog</a></h5>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/apps">Apps</a></h5>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="/">Platform</a></h5>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/press">Press</a></h5>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script src="/js/main.js?47"></script>
|
||
<script src="/js/jquery.min.js?1"></script>
|
||
<script src="/js/bootstrap.min.js?1"></script>
|
||
|
||
<script>window.initDevPageNav&&initDevPageNav();
|
||
backToTopInit("Go up");
|
||
removePreloadInit();
|
||
</script>
|
||
</body>
|
||
</html>
|
||
|