sendInvoice

Use this method to send invoices. On success, the sent Message is returned.

Arguments
Name Type Description Required
title string | array Product name, 1-32 characters yes
description string Product description, 1-255 characters yes
payload string Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. yes
provider_token string Payment provider token, obtained via @BotFather yes
currency string Three-letter ISO 4217 currency code, see more on currencies yes
prices labeledPrice[] | stdClass[] Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) yes
chat_id int | string | null Unique identifier for the target chat or username of the target channel (in the format @channelusername) no
message_thread_id int | null Unique identifier for the target message thread (topic) of the forum; for forum supergroups only no
max_tip_amount int | null The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0 no
suggested_tip_amounts int[] | null A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount. no
start_parameter string | null Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button),with the value used as the start parameter no
provider_data string | null JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider. no
photo_url string | null URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for. no
photo_size int | null Photo size in bytes no
photo_width int | null Photo width no
photo_height int | null Photo height no
need_name bool | null Pass True if you require the user's full name to complete the order no
need_phone_number bool | null Pass True if you require the user's phone number to complete the order no
need_email bool | null Pass True if you require the user's email address to complete the order no
need_shipping_address bool | null Pass True if you require the user's shipping address to complete the order no
send_phone_number_to_provider bool | null Pass True if the user's phone number should be sent to provider no
send_email_to_provider bool | null Pass True if the user's email address should be sent to provider no
is_flexible bool | null Pass True if the final price depends on the shipping method no
disable_notification bool | null Sends the message silently. Users will receive a notification with no sound. no
protect_content bool | null Protects the contents of the sent message from forwarding and saving no
reply_to_message_id int | null If the message is a reply, ID of the original message no
allow_sending_without_reply bool | null Pass True if the message should be sent even if the specified replied-to message is not found no
reply_markup inlineKeyboardMarkup | null | stdClass A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button. no
token string | null You can use this method on another bot with specify this parameter no
forgot bool | null You can set to not receive request result, dont set it or pass null for turn it off no
answer bool | null You can set to answer to webhook, dont set it or pass null for turn it off no

Output : BPT\types\message | BPT\types\responseError | bool

Static or normal : Static

Examples :

request::sendInvoice(title: string, description: string, payload: string, provider_token: string, currency: string, prices: Array, chat_id: int | string | null, message_thread_id: int | null, max_tip_amount: int | null, suggested_tip_amounts: Array | null, start_parameter: string | null, provider_data: string | null, photo_url: string | null, photo_size: int | null, photo_width: int | null, photo_height: int | null, need_name: bool | null, need_phone_number: bool | null, need_email: bool | null, need_shipping_address: bool | null, send_phone_number_to_provider: bool | null, send_email_to_provider: bool | null, is_flexible: bool | null, disable_notification: bool | null, protect_content: bool | null, reply_to_message_id: int | null, allow_sending_without_reply: bool | null, reply_markup: InlineKeyboardMarkup | null, token: String | null, forgot: Boolean | null, answer: Boolean | null);
request::sendInvoice(['title' => string, 'description' => string, 'payload' => string, 'provider_token' => string, 'currency' => string, 'prices' => Array, 'chat_id' => int | string | null, 'message_thread_id' => int | null, 'max_tip_amount' => int | null, 'suggested_tip_amounts' => Array | null, 'start_parameter' => string | null, 'provider_data' => string | null, 'photo_url' => string | null, 'photo_size' => int | null, 'photo_width' => int | null, 'photo_height' => int | null, 'need_name' => bool | null, 'need_phone_number' => bool | null, 'need_email' => bool | null, 'need_shipping_address' => bool | null, 'send_phone_number_to_provider' => bool | null, 'send_email_to_provider' => bool | null, 'is_flexible' => bool | null, 'disable_notification' => bool | null, 'protect_content' => bool | null, 'reply_to_message_id' => int | null, 'allow_sending_without_reply' => bool | null, 'reply_markup' => InlineKeyboardMarkup | null, 'token' => String | null, 'forgot' => Boolean | null, 'answer' => Boolean | null]);
request::sendInvoice(title: string, description: string, payload: string, provider_token: string, currency: string, prices: Array);
request::sendInvoice(['title' => string, 'description' => string, 'payload' => string, 'provider_token' => string, 'currency' => string, 'prices' => Array]);