payments.getPaymentForm
payments.getPaymentForm
Section titled “payments.getPaymentForm”No description provided by the pinned schema.
Signature
Section titled “Signature”payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm;Result type
Section titled “Result type”payments.PaymentForm
Parameters
Section titled “Parameters”| Name | Type | Flag | Default | Description |
|---|---|---|---|---|
| flags | # | flag word | — | No description provided by the pinned schema. |
| invoice | InputInvoice | — | — | No description provided by the pinned schema. |
| theme_params | flags.0?DataJSON | flags.0 | — | No description provided by the pinned schema. |
| Parameter | Bit | Meaning |
|---|---|---|
| theme_params | 0 | Controlled by flags; present when this bit is set. |
Python binding
Section titled “Python binding”from miniproto.raw.functions import PaymentsGetPaymentFormPublic access: miniproto.raw.functions.PaymentsGetPaymentForm.
Safe usage shape
Section titled “Safe usage shape”from miniproto.raw.functions import PaymentsGetPaymentForm
# Naming the raw request class is local only; it performs no I/O or network request.request_type = PaymentsGetPaymentFormResult family
Section titled “Result family”RPC errors
Section titled “RPC errors”| Code | Error | Description |
|---|---|---|
| 400 | BOOST_PEER_INVALID | The specified boost_peer is invalid. |
| 400 | BOT_INVOICE_INVALID | The specified invoice is invalid. |
| 400 | BUSINESS_CONNECTION_INVALID | The connection_id passed to the wrapping invokeWithBusinessConnection call is invalid. |
| 400 | BUSINESS_CONNECTION_NOT_ALLOWED | This method was invoked over a business connection using invokeWithBusinessConnection, but either (1) we’re a user, and users cannot invoke methods over a business connection; (2) we’re a bot, but business mode was disabled in @botfather or (3); we’re a bot, but this method cannot be invoked over a business connection. |
| 400 | GIFT_MONTHS_INVALID | The value passed in invoice.inputInvoicePremiumGiftStars.months is invalid. |
| 400 | GIFT_STARS_INVALID | The specified amount of stars is invalid. |
| 400 | INVOICE_INVALID | The specified invoice is invalid. |
| 400 | MESSAGE_ID_INVALID | The provided message id is invalid. |
| 400 | MESSAGE_TOO_LONG | The provided message is too long. |
| 400 | MONTH_INVALID | The number of months specified in inputInvoicePremiumGiftStars.months is invalid. |
| 400 | MSG_ID_INVALID | Invalid message ID provided. |
| 400 | NO_PAYMENT_NEEDED | The upgrade/transfer of the specified gift was already paid for or is free. |
| 400 | PEER_ID_INVALID | The provided peer id is invalid. |
| 400 | PREMIUM_PURPOSE_INVALID | The specified InputStorePaymentPurpose is invalid. |
| 400 | SLUG_INVALID | The specified invoice slug is invalid. |
| 400 | STARGIFT_ALREADY_CONVERTED | The specified star gift was already converted to Stars. |
| 400 | STARGIFT_ALREADY_REFUNDED | The specified star gift was already refunded. |
| 400 | STARGIFT_ALREADY_UPGRADED | The specified gift was already upgraded to a collectible gift. |
| 400 | STARGIFT_INVALID | The passed gift is invalid. |
| 400 | STARGIFT_MESSAGE_INVALID | The specified inputInvoiceStarGift.message is invalid. |
| 400 | STARGIFT_NOT_FOUND | The specified gift was not found. |
| 400 | STARGIFT_NOT_OWNER | You’re not the owner of the gift you trying to transfer. |
| 400 | STARGIFT_NOT_UNIQUE | You can’t transfer a non-collectible gift. |
| 400 | STARGIFT_OWNER_INVALID | You cannot transfer or sell a gift owned by another user. |
| 400 | STARGIFT_PEER_INVALID | The specified inputSavedStarGiftChat.peer is invalid. |
| 400 | STARGIFT_RESELL_CURRENCY_NOT_ALLOWED | You can’t buy the gift using the specified currency (i.e. trying to pay in Stars for TON gifts). |
| 400 | STARGIFT_RESELL_TOO_EARLY_%d | You will be able to resell this gift in %d seconds. |
| 400 | STARGIFT_SLUG_INVALID | The specified gift slug is invalid. |
| 400 | STARGIFT_TRANSFER_TOO_EARLY_%d | You cannot transfer this gift yet, wait %d seconds. |
| 400 | STARGIFT_UPGRADE_UNAVAILABLE | A received gift can only be upgraded to a collectible gift if the messageActionStarGift/savedStarGift.can_upgrade flag is set. |
| 400 | TO_ID_INVALID | The specified to_id of the passed inputInvoiceStarGiftResale or inputInvoiceStarGiftTransfer is invalid. |
| 400 | UNTIL_DATE_INVALID | Invalid until date provided. |
| 403 | BOT_ACCESS_FORBIDDEN | The 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. |
| 403 | USER_DISALLOWED_STARGIFTS | The 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. |
| 406 | API_GIFT_RESTRICTED_UPDATE_APP | Please update the app to access the gift API. |
| 406 | STARGIFT_EXPORT_IN_PROGRESS | A gift export is in progress, a detailed and localized description for the error will be emitted via an updateServiceNotification as specified here ». |
| 406 | STARS_FORM_AMOUNT_MISMATCH | The form amount has changed, please fetch the new form using payments.getPaymentForm and restart the process. |
Accepted types
Section titled “Accepted types”DataJSON, InputInvoice
Known selected constructors: dataJSON, inputInvoiceBusinessBotTransferStars, inputInvoiceChatInviteSubscription, inputInvoiceMessage, inputInvoicePremiumAuthCode, inputInvoicePremiumGiftCode, inputInvoicePremiumGiftStars, inputInvoiceSlug, inputInvoiceStarGift, inputInvoiceStarGiftAuctionBid, inputInvoiceStarGiftDropOriginalDetails, inputInvoiceStarGiftPrepaidUpgrade, inputInvoiceStarGiftResale, inputInvoiceStarGiftTransfer, inputInvoiceStarGiftUpgrade, inputInvoiceStars
Returned types
Section titled “Returned types”payments.PaymentForm
Known selected constructors: payments.paymentForm, payments.paymentFormStarGift, payments.paymentFormStars
Related methods
Section titled “Related methods”bots.answerWebhookJSONQuery, bots.invokeWebViewCustomMethod, bots.sendCustomRequest, help.acceptTermsOfService, messages.requestAppWebView, messages.requestChatJoinWebView, messages.requestMainWebView, messages.requestSimpleWebView, messages.requestWebView, payments.assignPlayMarketTransaction, payments.sendPaymentForm, payments.sendStarsForm, payments.validateRequestedInfo, phone.createConferenceCall, phone.getCallConfig, phone.joinGroupCall, phone.joinGroupCallPresentation, phone.saveCallDebug
Availability evidence
Section titled “Availability evidence”- business supported
- unauthenticated allowed
Provenance
Section titled “Provenance”- layer: 228
- structural source:
tdlib - canonical schema: https://raw.githubusercontent.com/tdlib/td/refs/heads/master/td/generate/scheme/telegram_api.tl
- prose merge precedence: TDLib → Telegram Desktop → Core JSON
- source note: Canonical structure is the pinned TDLib telegram_api.tl; Layer 228 comes only from the matching Telegram Desktop end-of-file marker; core.telegram.org inputs enrich documentation and RPC error metadata without overriding structure.
Source-diff notes
Section titled “Source-diff notes”- tdlib_vs_core: changed_count=68; core_only_count=1; overlap_count=2302; tdlib_only_count=158
- tdlib_vs_tdesktop: changed_count=0; overlap_count=2448; tdesktop_only=null; tdlib_only=accessPointRule, ephemeral.editMessage, help.configSimple, inputPeerPhotoFileLocationLegacy, inputStickerSetThumbLegacy, invokeWithApnsSecretPrefix, invokeWithBusinessConnectionPrefix, invokeWithGooglePlayIntegrityPrefix, invokeWithReCaptchaPrefix, ipPort, ipPortSecret, updateEphemeralBotCallbackQuery