Skip to main content

payments.getPaymentForm

Get a payment form

func (c *Client) PaymentsGetPaymentForm(ctx context.Context, request *PaymentsGetPaymentFormRequest) (PaymentsPaymentFormClass, error)

Calling this method

client.Run(ctx, func(ctx context.Context) error {
api := client.API()

res, err := api.PaymentsGetPaymentForm(ctx, &tg.PaymentsGetPaymentFormRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // PaymentsPaymentFormClass
return nil
})

Parameters

NameTypeRequiredDescription
InvoiceInputInvoiceClassyesInvoice
ThemeParamsDataJSONTheme parameters »

Returns

PaymentsPaymentFormClass

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_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_INVALID
400STARGIFT_NOT_FOUNDThe specified gift was not found.
400STARGIFT_NOT_OWNER
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_SLUG_INVALIDThe specified gift slug is invalid.
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.

References