payments.sendStarsForm #

Make a payment using Telegram Stars, see here » for more info.

Layer 223

payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;
payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;
---functions---
payments.sendStarsForm#7998c914 form_id:long invoice:InputInvoice = payments.PaymentResult;

Parameters #

NameTypeDescription
form_idlongPayment form ID
invoiceInputInvoiceInvoice

Result #

payments.PaymentResult

Both users and bots can use this method #

This method can be invoked over a business connection » #

Possible errors #

CodeTypeDescription
406API_GIFT_RESTRICTED_UPDATE_APPPlease update the app to access the gift API.
400BALANCE_TOO_LOWThe transaction cannot be completed because the current Telegram Stars balance is too low.
403BOT_ACCESS_FORBIDDENThe specified method can be used over a business connection for some operations, but the specified query attempted an operation that is not allowed over a business connection.
400BOT_INVOICE_INVALIDThe specified invoice is invalid.
400BUSINESS_CONNECTION_INVALIDThe connection_id passed to the wrapping invokeWithBusinessConnection call is invalid.
400FORM_EXPIREDThe form was generated more than 10 minutes ago and has expired, please re-generate it using payments.getPaymentForm and pass the new form_id.
400FORM_ID_EMPTYThe specified form ID is empty.
400FORM_SUBMIT_DUPLICATEThe same payment form was already submitted. .
400FORM_UNSUPPORTEDPlease update your client.
400GIFT_STARS_INVALIDThe specified amount of stars is invalid.
400MEDIA_ALREADY_PAIDYou already paid for the specified media.
400MONTH_INVALIDThe number of months specified in inputInvoicePremiumGiftStars.months is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.
406PRECHECKOUT_FAILEDPrecheckout failed, a detailed and localized description for the error will be emitted via an updateServiceNotification as specified here ».
400PURPOSE_INVALIDThe specified payment purpose is invalid.
400STARGIFT_ALREADY_UPGRADEDThe specified gift was already upgraded to a collectible gift.
400STARGIFT_NOT_FOUNDThe specified gift was not found.
400STARGIFT_OWNER_INVALIDYou cannot transfer or sell a gift owned by another user.
400STARGIFT_SLUG_INVALIDThe specified gift slug is invalid.
400STARGIFT_USAGE_LIMITEDThe gift is sold out.
400STARGIFT_USER_USAGE_LIMITEDYou've reached the starGift.limited_per_user limit, you can't buy any more gifts of this type.
406STARS_FORM_AMOUNT_MISMATCHThe form amount has changed, please fetch the new form using payments.getPaymentForm and restart the process.
400TO_ID_INVALIDThe specified to_id of the passed inputInvoiceStarGiftResale or inputInvoiceStarGiftTransfer is invalid.
400USER_ID_INVALIDThe provided user ID is invalid.

Telegram Stars #

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.

Connected business bots #

Users can connect Telegram bots that will process and answer messages on their behalf. This allows them to seamlessly integrate any existing tools and workflows, or add AI assistants that manage their chats.

Telegram Business #

Users can turn their Telegram account into a business account, gaining access to business features such as opening hours, location, quick replies, automated messages, custom start pages, chatbot support, and more.

payments.getPaymentForm #

Get a payment form

Error handling #

How to handle API return errors correctly.