sendInvoice

Send an invoice. Bot-only.

Parameters

chatId: ID

The chat to send the invoice to.

title: string

The invoice’s title.

description: string

The invoice’s description.

payload: string

The invoice’s payload.

currency: string

The invoice’s currency.

prices: PriceTag[]

The invoice’s price tags.

providerToken?: string
maxTipAmount?: number
suggestedTipAmounts?: number[]
startParameter?: string
providerData?: string
photoUrl?: string
photoSize?: number
photoWidth?: number
photoHeight?: number
needName?: boolean
needPhoneNumber?: boolean
needEmail?: boolean
needShippingAddress?: boolean
sendPhoneNumberToProvider?: boolean
sendEmailToProvider?: boolean
flexible?: boolean
disableNotification?: boolean

Whether to send the message in a silent way without making a sound on the recipients’ clients.

protectContent?: boolean

Whether to protect the contents of the message from copying and forwarding.

replyTo?: ReplyTo

Information on what the message is replying to.

messageThreadId?: number

The identifier of a thread to send the message to.

sendAs?: ID

The identifier of a chat to send the message on behalf of. User-only.

effectId?: number

The identifier of a message effect to be attached to the message.

sendAt?: Date

If specified, the message will be scheduled to be sent at that date. User-only.

businessConnectionId?: string

The identifier of a business connection ID to perform the action on. Bot-only.

paidBroadcast?: boolean
replyMarkup?: ReplyMarkup

The reply markup of the message. Bot-only.

Result

The sent invoice.

Syntax

// Required parameters only.
await client.sendInvoice(chatId, title, description, payload, currency, prices);

// Required parameters + optional parameters.
// Any of the optional parameters can be omitted.
await client.sendInvoice(chatId, title, description, payload, currency, prices, {
    providerToken,
    maxTipAmount,
    suggestedTipAmounts,
    startParameter,
    providerData,
    photoUrl,
    photoSize,
    photoWidth,
    photoHeight,
    needName,
    needPhoneNumber,
    needEmail,
    needShippingAddress,
    sendPhoneNumberToProvider,
    sendEmailToProvider,
    flexible,
    disableNotification,
    protectContent,
    replyTo,
    messageThreadId,
    sendAs,
    effectId,
    sendAt,
    businessConnectionId,
    paidBroadcast,
    replyMarkup,
});