payments.getPaymentForm #

Get a payment form

Layer 223

payments.paymentForm#a0058751 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON additional_methods:flags.6?Vector<PaymentFormMethod> saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?Vector<PaymentSavedCredentials> users:Vector<User> = payments.PaymentForm;
payments.paymentFormStars#7bf6b15c flags:# form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice users:Vector<User> = payments.PaymentForm;
payments.paymentFormStarGift#b425cfe1 form_id:long invoice:Invoice = payments.PaymentForm;
---functions---
payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
invoiceInputInvoiceInvoice
theme_paramsflags.0?DataJSONTheme parameters »

Result #

payments.PaymentForm

Both users and bots can use this method #

This method can be invoked over a business connection » #

This method can be invoked over an unauthenticated connection » #

Possible errors #

CodeTypeDescription
406API_GIFT_RESTRICTED_UPDATE_APPPlease update the app to access the gift API.
400BOOST_PEER_INVALIDThe specified boost_peer is invalid.
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.
400GIFT_MONTHS_INVALIDThe value passed in invoice.inputInvoicePremiumGiftStars.months is invalid.
400GIFT_STARS_INVALIDThe specified amount of stars is invalid.
400INVOICE_INVALIDThe specified invoice is invalid.
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400MESSAGE_TOO_LONGThe provided message is too long.
400MONTH_INVALIDThe number of months specified in inputInvoicePremiumGiftStars.months is invalid.
400MSG_ID_INVALIDInvalid message ID provided.
400NO_PAYMENT_NEEDEDThe upgrade/transfer of the specified gift was already paid for or is free.
400PEER_ID_INVALIDThe provided peer id is invalid.
400PREMIUM_PURPOSE_INVALIDThe specified InputStorePaymentPurpose is invalid.
400SLUG_INVALIDThe specified invoice slug is invalid.
400STARGIFT_ALREADY_CONVERTEDThe specified star gift was already converted to Stars.
400STARGIFT_ALREADY_REFUNDEDThe specified star gift was already refunded.
400STARGIFT_ALREADY_UPGRADEDThe specified gift was already upgraded to a collectible gift.
406STARGIFT_EXPORT_IN_PROGRESSA gift export is in progress, a detailed and localized description for the error will be emitted via an updateServiceNotification as specified here ».
400STARGIFT_INVALIDThe passed gift is invalid.
400STARGIFT_MESSAGE_INVALIDThe specified inputInvoiceStarGift.message is invalid.
400STARGIFT_NOT_FOUNDThe specified gift was not found.
400STARGIFT_NOT_OWNERYou're not the owner of the gift you trying to transfer.
400STARGIFT_NOT_UNIQUEYou can't transfer a non-collectible gift.
400STARGIFT_OWNER_INVALIDYou cannot transfer or sell a gift owned by another user.
400STARGIFT_PEER_INVALIDThe specified inputSavedStarGiftChat.peer is invalid.
400STARGIFT_RESELL_CURRENCY_NOT_ALLOWEDYou can't buy the gift using the specified currency (i.e. trying to pay in Stars for TON gifts).
400STARGIFT_RESELL_TOO_EARLY_%dYou will be able to resell this gift in %d seconds.
400STARGIFT_SLUG_INVALIDThe specified gift slug is invalid.
400STARGIFT_TRANSFER_TOO_EARLY_%dYou cannot transfer this gift yet, wait %d seconds.
400STARGIFT_UPGRADE_UNAVAILABLEA received gift can only be upgraded to a collectible gift if the messageActionStarGift/savedStarGift.can_upgrade flag is set.
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.
400UNTIL_DATE_INVALIDInvalid until date provided.
403USER_DISALLOWED_STARGIFTSThe recipient user has configured restrictions on which categories of star gifts they're willing to accept (unique, limited, or unlimited): the sender attempted to get a payment form for a gift that falls into a category the recipient has blocked.

Mini Apps on Telegram #

Bots can offer users interactive HTML5 web apps to completely replace any website.

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.

Error handling #

How to handle API return errors correctly.

messageActionStarGift #

You received a gift, see here » for more info.

savedStarGift #

Represents a gift owned by a peer.

payments.getPaymentForm #

Get a payment form