Class PreCheckoutQuery

Hierarchy (view full)

  • Base
    • PreCheckoutQuery

Constructors

Properties

author: User

User who sent the query

currency: string

Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars

id: string

Unique query identifier

invoicePayload: string

Bot specified invoice payload

orderInfo?: OrderInfo

Order information provided by the user

shippingOptionId?: string

Identifier of the shipping option chosen by the user

totalAmount: number

Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)

Accessors

Methods

  • Protected

    Patches the current instance with new data

    Parameters

    • data: Record<string, any>

      The data to patch the instance with

    Returns Record<string, any>

    The patched data

  • Protected

    Updates the current instance with new data and returns a clone of the updated instance

    Parameters

    • data: Record<string, any>

      The data to update the instance with

    Returns Base

    A clone of the updated instance

  • Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries.

    Parameters

    • ok: boolean

      Specify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems

    • OptionalerrorMessage: string

      Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user

    Returns Promise<true>

    On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.