createInvoiceLink

Use this method to create a link for an invoice. Returns the created invoice link as String on success.

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
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
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. 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 the provider no
send_email_to_provider bool | null Pass True if the user's email address should be sent to the provider no
is_flexible bool | null Pass True if the final price depends on the shipping method 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 : string | BPT\types\responseError | bool

Static or normal : Static

Examples :

request::createInvoiceLink(title: string, description: string, payload: string, provider_token: string, currency: string, prices: Array, max_tip_amount: int | null, suggested_tip_amounts: Array | 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, token: String | null, forgot: Boolean | null, answer: Boolean | null);
request::createInvoiceLink(['title' => string, 'description' => string, 'payload' => string, 'provider_token' => string, 'currency' => string, 'prices' => Array, 'max_tip_amount' => int | null, 'suggested_tip_amounts' => Array | 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, 'token' => String | null, 'forgot' => Boolean | null, 'answer' => Boolean | null]);
request::createInvoiceLink(title: string, description: string, payload: string, provider_token: string, currency: string, prices: Array);
request::createInvoiceLink(['title' => string, 'description' => string, 'payload' => string, 'provider_token' => string, 'currency' => string, 'prices' => Array]);