payments.canPurchasePremium

Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase, official apps only.

 Method schema is available as of layer 144. Switch »

Parameters

This constructor does not require any parameters.

Result

 

Possible errors

Code Type Description
406 PREMIUM_CURRENTLY_UNAVAILABLE You cannot currently purchase a Premium subscription.
400 USER_GIFT_UNAVAILABLE Gifts are not available in the current region (stars_gifts_enabled is equal to false).
400 USER_ID_INVALID The provided user ID is invalid.

Both users and bots can use this method

Related pages

Client configuration

The MTProto API has multiple configuration parameters that can be fetched with the appropriate methods.