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
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
message_thread_id int | null Unique identifier for the target message thread (topic) of the forum; for forum supergroups only no

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

Static or normal : Static

Examples :

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