Bot Payments API #

Payments API. Click for hi-res picture

Telegram Bot Payments are a free and open platform that allows sellers to accept payments for goods and services from Telegram users. Telegram doesn't collect payment information and takes no commission. This page covers payments for physical goods and services – if you’re interested in selling digital goods and services, please check out our dedicated page.

Note: This article is intended for bot developers and store owners. If you're looking for a general overview of Telegram Payments for physical goods and services, check out the Telegram blog.

If you are new to Telegram bots and would like to learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ.

Payments for Physical Products #

Payments for physical goods and services were first added to Telegram in 2017 and allow bots to:

  • Accept payments from over 200 countries using more than 20 providers.
  • Send invoices to any chat, including groups and channels.
  • Receive payments from users on mobile or desktop apps.
  • Try @ShopBot to create a test invoice – or start a message with @ShopBot ... in any chat for an inline invoice.
  • Check out Demo Shop for an example of a Telegram Channel used as virtual storefront.

Check out @ShopBot for an example of a virtual storefront – then use our dedicated guides for digital and physical products to build your own.

How does this work? #

You create a bot that offers goods and services to Telegram users. Merchant bots can send specially formatted invoice messages to users, groups or channels. If your bot supports inline mode, users can also send invoices to other chats via the bot, including to one-on-one chats with other users.

Invoice messages feature a photo and description of the product along with a prominent Pay button. Tapping this button opens a special payment interface in the Telegram app. In this interface, users can choose a tip amount (if allowed by the merchant) and enter additional details like shipping info, phone number, or email address.

The bot can offer several shipping options for physical goods based on the delivery address. When ready, users enter their credit card info or choose a saved card — and pay for the product. Telegram also supports Apple Pay and Google Pay. Once the transaction is done, the merchant bot can send a receipt message with payment details, shipping and delivery information.

Detailed information and step-by-step instructions are available below.

Payments Through Third-Party Providers #

Telegram does not process payments from users and instead allows developers to integrate directly with different third-party payment providers around the world. It is the payment providers that handle and store all sensitive information, like credit card details. Neither Telegram nor the bot developers have access to it.

If you work for a company that provides services similar to standalone accounts in Stripe Connect, please let us know via @BotSupport (include the hashtag #paymentsprovider in your message).


The Payments API #

This section explores payments via Telegram's Bot API in more detail.

Connecting Payments #

To start accepting payments, you need a Telegram bot. Use BotFather to create a bot if you don't have one already.

Now you have a merchant bot that can offer goods or services to Telegram users. Let's call it @merchantbot in this document.

Getting a Token #

  • Use the /mybots command in the chat with BotFather and choose the @merchantbot that will be offering goods or services.
  • Go to Bot Settings > Payments.
  • Choose a provider, and you will be redirected to the relevant bot.
  • Enter the required details so that the payments provider is connected successfully, go back to the chat with Botfather.
  • The message will now show available providers. Each will have a name, a token, and the date the provider was connected.
  • You will use the token when working with the Bot API.

Implementing Payments #

You will find the necessary methods for building your payment implementation in the Payments Section of the Bot API Manual.

Testing Payments: the 'Stripe TEST MODE' Provider #

While you're still developing and testing payments for your bot, use the “Stripe TEST MODE” provider. When in this mode, you can make payments without actually billing any accounts. Real cards can't be used in test mode, but you can use test cards like 4242 4242 4242 4242 (full list here). You can switch between test mode and live mode as many times as you want, but please see the live checklist before you go live.

Step-by-Step Process #

See Bot API: Payments for the complete list of available methods and objects.

1. Create Invoice #

The user contacts @merchantbot and requests to purchase something. The bot forms an invoice message with a description of the goods or service, amount to be paid, and requested shipping info. There are two ways of creating an invoice:

A. Bot Invoice #

Use the sendInvoice method to generate an invoice and send it to a chat. The provider_token parameter is where you put the token value that you've obtained earlier via Botfather. It is possible for one merchant bot to use several different tokens for different users or different goods and services.

Invoice messages with a pay button can be sent to chats of any type: private chats with the user, groups, or channels. The resulting invoice message will look like this:

Join button

Bot Invoice

B. Inline Invoice #

If @merchantbot supports inline mode, you can use inputInvoiceMessageContent to allow users to share invoices for your goods and services to their one-on-one chats with friends, or to their groups and channels. These invoices will have a Pay button that can be used multiple times.

Join button

Inline Invoice

2. Choose Forwarding Behavior #

There are two ways for handling forwarded copies of your invoices, controlled by the parameter start_parameter in the sendInvoice method.

  • A. Multi-chat invoice. Forwarded copies show a Pay button, which multiple users can press and attempt to pay for the goods or services. Inline invoices are always multi-chat invoices.
  • B. Single-chat invoice. Invoice can only be paid from the chat to which it was sent, forwarded copies show a URL button with a deep link to the bot. The deep link can be used to generate a similar invoice in the chat with the bot, to show an error message, or for other purposes. More info on Deep Linking »

If a single-chat invoice is sent to the chat with @merchantbot, it can only be paid once. If a single-chat invoice is sent to any other chat, it can be paid many times by many users.

To get a better understanding of how this works, try toggling the “Pay from Forwards” parameter when creating invoices with our demo @ShopBot.

Regardless of whether or not the Pay button is available in an invoice, the merchant bot always has the power to decide whether or not to accept new payments for a particular invoice.

3. Tips (optional step) #

If the max_tip_amount parameter is set to above 0, users can add a tip to their payment. You can use the parameter suggested_tip_amounts to suggest particular amounts that you feel will be relevant for the invoice.

Join button

Adding Tips

4. Shipping info and other details (optional step) #

The user specifies shipping information or other info requested by the bot. This could be the user's full name, an email address, a phone number in international format, or a full postal address for delivery.

Shipping Info

Shipping Info

5. Offer delivery options based on shipping address (optional step) #

If a shipping address was requested and you included the parameter is_flexible, the Bot API will send an Update with a shipping_query field to the bot. The bot must respond using answerShippingQuery either with a list of possible delivery options and the relevant delivery prices, or with an error (for example, if delivery to the specified address is not possible).

Tip: It is recommended that the merchant bot confirms availability of the goods/services at this step – to let the user know in case they are no longer available. This is especially important if you are using multi-chat, inline or single-chat, multi-use invoices.

6. Select delivery option (optional step) #

The user selects a delivery option from the list (the overall amount to be paid may change at this point) and proceeds to checkout.

Choose Delivery Option

Choose Delivery Option

7. Pre-Checkout #

The user enters their payment information and presses the final pay button. At this moment the Bot API sends an Update with the field pre_checkout_query to the bot that contains all the available information about the order. Your bot must reply using answerPrecheckoutQuery within 10 seconds after receiving this update or the transaction is canceled.

The bot may return an error if it can't process the order for any reason. We highly recommend specifying a reason for failure to complete the order in human readable form (e.g. "Sorry, we're all out of rubber ducks! Would you be interested in a cast iron bear instead?"). Telegram will display this reason to the user.

Warning: It is critical to make sure your bot only accepts multiple payments when the order can be processed correctly. This is especially important if you are using multi-chat, inline or single-chat, multi-use invoices.

8. Checkout #

In case the bot confirms the order, Telegram requests the payment provider to complete the transaction. If the payment information was entered correctly and the payment goes through, the API will send a receipt message of the type successful_payment from the user. Once your bot receives this message, it should proceed with delivering the goods or services purchased by the user.

If the invoice message was sent in the chat with @merchantbot, it becomes a Receipt in the UI for the user — they can open this receipt at any time and see all the details of the transaction:

Receipt

Receipt

If the message was sent to any other chat, the Pay button remains and can be used again. It is up to the merchant bot whether to actually accept multiple payments.

Going Live #

Once you've tested everything and confirmed that your payments implementation works, you're ready to switch to LIVE MODE. To do this, go to BotFather > /mybots > select @merchantbot > Bot Settings / Payments and enable Stripe LIVE MODE. You will get a token that has the string :LIVE: in the middle, e.g. 123:LIVE:XXXX. Do not give this token to any third parties!

Before your merchant bot goes into live mode, please ensure the following:

Live Checklist #

  • We highly recommend turning on 2-step verification for the Telegram account that controls your bot.
  • You as the bot owner have full responsibility in case any conflicts or disputes arise. You must be prepared to correctly process disputes and chargebacks (in the case of Stripe, see here).
  • To prevent any misunderstandings and possible legal issues, make sure your bot can respond to a /terms command (or offers a similarly easy way of accessing your Terms and Conditions). Your Terms and Conditions should be written in a clear way and easy to understand for your users. The users must confirm that they have read and agree to your terms before they make the purchase.
  • Your bot must provide support for its customers, either by responding to a /support command or by some other clearly communicated means. Users must have a clear way of contacting you about their purchases and you must process their support requests in a timely fashion. You must notify your users that Telegram support or bot support will not able to help them with purchases made via your bot.
  • Make sure that your server hardware and software is stable. Use backups to make sure that you don't lose data about your users' payments.
  • Make sure that you have completed the live checklist for your selected payments provider as well as this one.

FAQ #

How do I join as a payment provider? #

If you work for a company that provides services similar to standalone accounts in Stripe Connect, please let us know via @BotSupport (kindly include the hashtag #paymentsprovider in your message).

How much do you charge? #

Telegram does not charge any commission for using the Payments API. Note though, that most payment providers will have their own commissions. For example, Stripe in the US charges 2.9% + 30¢ per successful card charge (see the Stripe website for more details on pricing).

Do I need a bot to accept payments? #

Yes. If you are not a developer, you will need to either hire someone to make a bot for you (recommended), or use a bot created by a third-party company. We advise extreme caution when using services of bots that process payments for you – Telegram doesn't maintain any such bots and doesn't endorse any of the third-party bots offering these services.

What can my bot sell? #

Telegram does not impose any limits on what products or services your bot can offer. But please note that you must comply with the rules of the payments provider you choose in our system. E.g., Stripe has a special page for prohibited businesses – you may want to consult that one before you start selling harvested organs.

Special Note: Due to Apple's limitations, bot developers are currently not allowed to accept payments for digital goods and virtual services from iOS users.

UPD 2024: Thanks to recent changes in the Apple Review Guidelines, users will soon be able to pay for digital goods and services with Telegram Stars on all platforms.

How are disputes handled? #

Telegram acts as a messenger between the paying user, the bot developer, and their chosen payment system. The user sends their credit card details directly to the payment system. Then the payment system's response and the shipping details entered by the user are passed to the bot developer so that they can process the order.

Since Telegram doesn‘t process the payments, we don’t store and can‘t access any sensitive data. Due to this structure, it is impossible for Telegram to handle complaints or cashbacks – any disputed payments are the responsibility of the bot developers, payment providers, and banks that participated in the exchange.

See also: Telegram Privacy Policy

How do I support payments in my third-party app that uses the Telegram API? #

You are welcome to study the MTProto payment documentation.

Supported Currencies #

Telegram payments currently support the currencies listed below (here's a JSON version in case you need it).

If you're using Stripe as the payments provider, supported currencies may vary depending on the country you have specified in your Stripe account (more info).

The minimum and maximum amounts for each of the currencies roughly correspond to the limit of US$ 1-10000. The amount must be expressed in 12 digits or less, so the maximum value will be correspondingly lower for some lower-value currencies. Note that for each currency except USD these limits depend on exchange rates and may change over time (plan ahead for this when you implement limits in your code).

CodeTitleMin amountMax amount
AEDUnited Arab Emirates DirhamAED 3.67AED 36,729.47
AFNAfghan AfghaniAFN72.60AFN726,016.70
ALLAlbanian Lek87,70ALL876.972,42ALL
AMDArmenian Dram390.68 AMD3,906,802.09 AMD
ARSArgentine PesoARS 1.198,23ARS 11.982.342,03
AUDAustralian DollarAU$1.58AU$15,750.39
AZNAzerbaijani Manat1,70 AZN17 017,91 AZN
BAMBosnia & Herzegovina Convertible Mark1,73 BAM17.255,51 BAM
BDTBangladeshi TakaBDT 121.61BDT 1,216,126.20
BGNBulgarian Lev1,73 BGN17 262,03 BGN
BHDBahraini dinarBHD 0.377BHD 3,768.690
BNDBrunei DollarBND1,32BND13.169,58
BOBBolivian BolivianoBOB 6,92BOB 69.160,83
BRLBrazilian RealR$ 5,89R$ 58.879,01
BYNBelarusian ruble3,28 BYN32 755,01 BYN
CADCanadian DollarCA$1.39CA$13,938.70
CHFSwiss Franc0.82 CHF8'158.79 CHF
CLPChilean PesoCLP 969CLP 9.694.501
CNYChinese Renminbi YuanCN¥7.35CN¥73,484.60
COPColombian PesoCOP 4.351,00COP 43.510.000,00
CRCCosta Rican ColónCRC505,71CRC5.057.148,78
CZKCzech Koruna22,12 CZK221 236,02 CZK
DKKDanish Krone6,58 DKK65835,85 DKK
DOPDominican PesoDOP61.16DOP611,592.20
DZDAlgerian DinarDZD 132.62DZD 1,326,179.86
EGPEgyptian PoundEGP 50.98EGP 509,827.03
ETBEthiopian BirrETB132.53ETB1,325,303.83
EUREuro0,88 €8 817,10 €
GBPBritish Pound£0.75£7,539.95
GELGeorgian Lari2,75 GEL27 496,46 GEL
GHSGhanaian cediGHS15.51GHS155,137.66
GTQGuatemalan QuetzalGTQ7.72GTQ77,172.49
HKDHong Kong DollarHK$7.76HK$77,573.85
HNLHonduran LempiraHNL 25.95HNL 259,476.72
HRKCroatian Kuna6,64 HRK66.422,00 HRK
HUFHungarian Forint359,61 HUF3 596 060,17 HUF
IDRIndonesian RupiahIDR16.843,40IDR168.434.000,00
ILSIsraeli New Sheqel₪ 3.68₪ 36,788.20
INRIndian Rupee₹85.54₹855,405.50
IQDIraqi dinarIQD 1,311.147IQD 13,111,470.880
IRRIranian rial42,112/50 IRR421,124,986/09 IRR
ISKIcelandic Króna128 ISK1.281.102 ISK
JMDJamaican DollarJMD158.35JMD1,583,505.01
JODJordanian dinarJOD0.709JOD7,092.020
JPYJapanese Yen¥142¥1,424,895
KESKenyan ShillingKES129.70KES1,297,008.65
KGSKyrgyzstani Som87-45 KGS874 492-05 KGS
KRWSouth Korean Won₩1,428₩14,281,050
KZTKazakhstani TengeKZT517-84KZT5 178 372-13
LBPLebanese PoundLBP 89,680.40LBP 896,803,991.37
LKRSri Lankan RupeeLKR 298.37LKR 2,983,673.52
MADMoroccan DirhamMAD 9.30MAD 92,950.95
MDLMoldovan Leu17.29 MDL172,911.07 MDL
MMKMyanmar kyatMMK2,099.52MMK20,995,177.49
MNTMongolian TögrögMNT3 535,48MNT35 354 753,21
MOPMacanese patacaMOP8.00MOP79,984.29
MURMauritian RupeeMUR45.09MUR450,944.18
MVRMaldivian Rufiyaa15.41 MVR154,102.22 MVR
MXNMexican PesoMX$20.12MX$201,198.97
MYRMalaysian RinggitMYR4.42MYR44,159.51
MZNMozambican MeticalMZN63.90MZN638,979.70
NGNNigerian NairaNGN1,604.82NGN16,048,198.43
NIONicaraguan CórdobaNIO 36.83NIO 368,349.31
NOKNorwegian KroneNOK 10,62NOK 106 231,30
NPRNepalese RupeeNPR137.23NPR1,372,285.38
NZDNew Zealand DollarNZ$1.69NZ$16,909.75
PABPanamanian BalboaPAB 1.00PAB 10,009.31
PENPeruvian Nuevo SolPEN 3.74PEN 37,391.65
PHPPhilippine PesoPHP56.59PHP565,894.98
PKRPakistani RupeePKR280.83PKR2,808,293.37
PLNPolish Złoty3,80 PLN37 960,65 PLN
PYGParaguayan GuaraníPYG 7.999PYG 79.986.942
QARQatari RiyalQAR 3.65QAR 36,536.72
RONRomanian Leu4,39 RON43.889,02 RON
RSDSerbian Dinar103,45 RSD1.034.456,90 RSD
RUBRussian Ruble87,73 RUB877 271,92 RUB
SARSaudi RiyalSAR 3.75SAR 37,524.26
SEKSwedish Krona9,84 SEK98.413,65 SEK
SGDSingapore DollarSGD1.32SGD13,154.65
SYPSyrian poundSYP 13,001.86SYP 130,018,582.69
THBThai Baht฿33.32฿333,234.95
TJSTajikistani Somoni10;85 TJS108 497;55 TJS
TRYTurkish Lira38,11 TRY381.131,98 TRY
TTDTrinidad and Tobago DollarTTD6.80TTD67,969.77
TWDNew Taiwan DollarNT$32.49NT$324,874.98
TZSTanzanian ShillingTZS2,665.00TZS26,650,002.38
UAHUkrainian Hryvnia41,22UAH412 168,53UAH
UGXUgandan ShillingUGX3,669UGX36,693,767
USDUnited States Dollar$1.00$10,000.00
UYUUruguayan PesoUYU 42,70UYU 427.028,05
UZSUzbekistani Som12 980,89 UZS129 808 943,61 UZS
VNDVietnamese Đồng25.868 ₫258.675.000 ₫
YERYemeni RialYER 245.33YER 2,453,250.35
ZARSouth African RandZAR 19.03ZAR 190,316.50