Contents Menu Expand Light mode Dark mode Auto light/dark mode Skip to content
banana documentation
banana documentation
  • User Guide
    • Quick start
    • Basic: agents
      • WinAPI-based agents
      • cpr-based agents
      • boost::beast-based agents
      • cpp-httplib-based agents
  • API Reference
    • Banana API
      • Banana Basic Types
      • Banana Agents
        • WinAPI-based agents
        • cpr-based agents
        • boost::beast-based agents
        • cpp-httplib-based agents
    • Telegram API
      • Telegram Types
        • animation_t
        • audio_t
        • bot_command_scope_all_chat_administrators_t
        • bot_command_scope_all_group_chats_t
        • bot_command_scope_all_private_chats_t
        • bot_command_scope_chat_administrators_t
        • bot_command_scope_chat_member_t
        • bot_command_scope_chat_t
        • bot_command_scope_default_t
        • bot_command_scope_t
        • bot_command_t
        • bot_description_t
        • bot_name_t
        • bot_short_description_t
        • callback_game_t
        • callback_query_t
        • chat_administrator_rights_t
        • chat_boost_added_t
        • chat_boost_removed_t
        • chat_boost_source_gift_code_t
        • chat_boost_source_giveaway_t
        • chat_boost_source_premium_t
        • chat_boost_source_t
        • chat_boost_t
        • chat_boost_updated_t
        • chat_invite_link_t
        • chat_join_request_t
        • chat_location_t
        • chat_member_administrator_t
        • chat_member_banned_t
        • chat_member_left_t
        • chat_member_member_t
        • chat_member_owner_t
        • chat_member_restricted_t
        • chat_member_t
        • chat_member_updated_t
        • chat_permissions_t
        • chat_photo_t
        • chat_shared_t
        • chat_t
        • chosen_inline_result_t
        • contact_t
        • dice_t
        • document_t
        • encrypted_credentials_t
        • encrypted_passport_element_t
        • external_reply_info_t
        • file_t
        • force_reply_t
        • forum_topic_closed_t
        • forum_topic_created_t
        • forum_topic_edited_t
        • forum_topic_reopened_t
        • forum_topic_t
        • game_high_score_t
        • game_t
        • general_forum_topic_hidden_t
        • general_forum_topic_unhidden_t
        • giveaway_completed_t
        • giveaway_created_t
        • giveaway_t
        • giveaway_winners_t
        • inaccessible_message_t
        • inline_keyboard_button_t
        • inline_keyboard_markup_t
        • inline_query_result_article_t
        • inline_query_result_audio_t
        • inline_query_result_cached_audio_t
        • inline_query_result_cached_document_t
        • inline_query_result_cached_gif_t
        • inline_query_result_cached_mpeg4_gif_t
        • inline_query_result_cached_photo_t
        • inline_query_result_cached_sticker_t
        • inline_query_result_cached_video_t
        • inline_query_result_cached_voice_t
        • inline_query_result_contact_t
        • inline_query_result_document_t
        • inline_query_result_game_t
        • inline_query_result_gif_t
        • inline_query_result_location_t
        • inline_query_result_mpeg4_gif_t
        • inline_query_result_photo_t
        • inline_query_result_t
        • inline_query_result_venue_t
        • inline_query_result_video_t
        • inline_query_result_voice_t
        • inline_query_results_button_t
        • inline_query_t
        • input_contact_message_content_t
        • input_file_t
        • input_invoice_message_content_t
        • input_location_message_content_t
        • input_media_animation_t
        • input_media_audio_t
        • input_media_document_t
        • input_media_photo_t
        • input_media_t
        • input_media_video_t
        • input_message_content_t
        • input_sticker_t
        • input_text_message_content_t
        • input_venue_message_content_t
        • invoice_t
        • keyboard_button_poll_type_t
        • keyboard_button_request_chat_t
        • keyboard_button_request_users_t
        • keyboard_button_t
        • labeled_price_t
        • link_preview_options_t
        • location_t
        • login_url_t
        • mask_position_t
        • maybe_inaccessible_message_t
        • menu_button_commands_t
        • menu_button_default_t
        • menu_button_t
        • menu_button_web_app_t
        • message_auto_delete_timer_changed_t
        • message_entity_t
        • message_id_t
        • message_origin_channel_t
        • message_origin_chat_t
        • message_origin_hidden_user_t
        • message_origin_t
        • message_origin_user_t
        • message_reaction_count_updated_t
        • message_reaction_updated_t
        • message_t
        • order_info_t
        • passport_data_t
        • passport_element_error_data_field_t
        • passport_element_error_file_t
        • passport_element_error_files_t
        • passport_element_error_front_side_t
        • passport_element_error_reverse_side_t
        • passport_element_error_selfie_t
        • passport_element_error_t
        • passport_element_error_translation_file_t
        • passport_element_error_translation_files_t
        • passport_element_error_unspecified_t
        • passport_file_t
        • photo_size_t
        • poll_answer_t
        • poll_option_t
        • poll_t
        • pre_checkout_query_t
        • proximity_alert_triggered_t
        • reaction_count_t
        • reaction_type_custom_emoji_t
        • reaction_type_emoji_t
        • reaction_type_t
        • reply_keyboard_markup_t
        • reply_keyboard_remove_t
        • reply_parameters_t
        • response_parameters_t
        • sent_web_app_message_t
        • shipping_address_t
        • shipping_option_t
        • shipping_query_t
        • sticker_set_t
        • sticker_t
        • story_t
        • successful_payment_t
        • switch_inline_query_chosen_chat_t
        • text_quote_t
        • update_t
        • user_chat_boosts_t
        • user_profile_photos_t
        • user_t
        • users_shared_t
        • venue_t
        • video_chat_ended_t
        • video_chat_participants_invited_t
        • video_chat_scheduled_t
        • video_chat_started_t
        • video_note_t
        • video_t
        • voice_t
        • web_app_data_t
        • web_app_info_t
        • webhook_info_t
        • write_access_allowed_t
      • Telegram Methods
        • add_sticker_to_set
        • answer_callback_query
        • answer_inline_query
        • answer_pre_checkout_query
        • answer_shipping_query
        • answer_web_app_query
        • approve_chat_join_request
        • ban_chat_member
        • ban_chat_sender_chat
        • close
        • close_forum_topic
        • close_general_forum_topic
        • copy_message
        • copy_messages
        • create_chat_invite_link
        • create_forum_topic
        • create_invoice_link
        • create_new_sticker_set
        • decline_chat_join_request
        • delete_chat_photo
        • delete_chat_sticker_set
        • delete_forum_topic
        • delete_message
        • delete_messages
        • delete_my_commands
        • delete_sticker_from_set
        • delete_sticker_set
        • delete_webhook
        • edit_chat_invite_link
        • edit_forum_topic
        • edit_general_forum_topic
        • edit_message_caption
        • edit_message_live_location
        • edit_message_media
        • edit_message_reply_markup
        • edit_message_text
        • export_chat_invite_link
        • forward_message
        • forward_messages
        • get_chat
        • get_chat_administrators
        • get_chat_member
        • get_chat_member_count
        • get_chat_menu_button
        • get_custom_emoji_stickers
        • get_file
        • get_forum_topic_icon_stickers
        • get_game_high_scores
        • get_me
        • get_my_commands
        • get_my_default_administrator_rights
        • get_my_description
        • get_my_name
        • get_my_short_description
        • get_sticker_set
        • get_updates
        • get_user_chat_boosts
        • get_user_profile_photos
        • get_webhook_info
        • hide_general_forum_topic
        • leave_chat
        • log_out
        • pin_chat_message
        • promote_chat_member
        • reopen_forum_topic
        • reopen_general_forum_topic
        • restrict_chat_member
        • revoke_chat_invite_link
        • send_animation
        • send_audio
        • send_chat_action
        • send_contact
        • send_dice
        • send_document
        • send_game
        • send_invoice
        • send_location
        • send_media_group
        • send_message
        • send_photo
        • send_poll
        • send_sticker
        • send_venue
        • send_video
        • send_video_note
        • send_voice
        • set_chat_administrator_custom_title
        • set_chat_description
        • set_chat_menu_button
        • set_chat_permissions
        • set_chat_photo
        • set_chat_sticker_set
        • set_chat_title
        • set_custom_emoji_sticker_set_thumbnail
        • set_game_score
        • set_message_reaction
        • set_my_commands
        • set_my_default_administrator_rights
        • set_my_description
        • set_my_name
        • set_my_short_description
        • set_passport_data_errors
        • set_sticker_emoji_list
        • set_sticker_keywords
        • set_sticker_mask_position
        • set_sticker_position_in_set
        • set_sticker_set_thumbnail
        • set_sticker_set_title
        • set_webhook
        • stop_message_live_location
        • stop_poll
        • unban_chat_member
        • unban_chat_sender_chat
        • unhide_general_forum_topic
        • unpin_all_chat_messages
        • unpin_all_forum_topic_messages
        • unpin_all_general_forum_topic_messages
        • unpin_chat_message
        • upload_sticker_file
Versions
  • v0.3.0
  • v0.4.0
  • v0.5.0
  • master
Back to top

create_invoice_link¶

template<class Agent>
api_result<string_t, Agent&&> create_invoice_link(Agent &&agent, create_invoice_link_args_t args)¶
template<class Agent, class F>
void create_invoice_link(Agent &&agent, create_invoice_link_args_t args, F &&callback)¶

agent is any object satisfying agent concept.

callback is any callable object accepting expected<string_t>.

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

struct create_invoice_link_args_t¶

Arguments that should be passed to create_invoice_link().

string_t title¶

Product name, 1-32 characters

string_t description¶

Product description, 1-255 characters

string_t payload¶

Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.

string_t currency¶

Three-letter ISO 4217 currency code, see more on currencies. Pass “XTR” for payments in Telegram Stars.

array_t<labeled_price_t> prices¶

Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.

optional_t<string_t> provider_token¶

Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.

optional_t<integer_t> subscription_period¶

The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified. Any number of subscriptions can be active for a given bot at the same time, including multiple concurrent subscriptions from the same user. Subscription price must no exceed 2500 Telegram Stars.

optional_t<integer_t> max_tip_amount¶

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. Not supported for payments in Telegram Stars.

optional_t<array_t<integer_t>> suggested_tip_amounts¶

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.

optional_t<string_t> provider_data¶

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.

optional_t<string_t> photo_url¶

URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.

optional_t<integer_t> photo_size¶

Photo size in bytes

optional_t<integer_t> photo_width¶

Photo width

optional_t<integer_t> photo_height¶

Photo height

optional_t<boolean_t> need_name¶

Pass True if you require the user’s full name to complete the order. Ignored for payments in Telegram Stars.

optional_t<boolean_t> need_phone_number¶

Pass True if you require the user’s phone number to complete the order. Ignored for payments in Telegram Stars.

optional_t<boolean_t> need_email¶

Pass True if you require the user’s email address to complete the order. Ignored for payments in Telegram Stars.

optional_t<boolean_t> need_shipping_address¶

Pass True if you require the user’s shipping address to complete the order. Ignored for payments in Telegram Stars.

optional_t<boolean_t> send_phone_number_to_provider¶

Pass True if the user’s phone number should be sent to the provider. Ignored for payments in Telegram Stars.

optional_t<boolean_t> send_email_to_provider¶

Pass True if the user’s email address should be sent to the provider. Ignored for payments in Telegram Stars.

optional_t<boolean_t> is_flexible¶

Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.

optional_t<string_t> business_connection_id¶

Unique identifier of the business connection on behalf of which the link will be created. For payments in Telegram Stars only.

Next
create_new_sticker_set
Previous
create_forum_topic
Copyright © 2020-2024
Made with Sphinx and @pradyunsg's Furo
On this page
  • create_invoice_link
    • create_invoice_link()
    • create_invoice_link()
    • create_invoice_link_args_t
      • create_invoice_link_args_t::title
      • create_invoice_link_args_t::description
      • create_invoice_link_args_t::payload
      • create_invoice_link_args_t::currency
      • create_invoice_link_args_t::prices
      • create_invoice_link_args_t::provider_token
      • create_invoice_link_args_t::subscription_period
      • create_invoice_link_args_t::max_tip_amount
      • create_invoice_link_args_t::suggested_tip_amounts
      • create_invoice_link_args_t::provider_data
      • create_invoice_link_args_t::photo_url
      • create_invoice_link_args_t::photo_size
      • create_invoice_link_args_t::photo_width
      • create_invoice_link_args_t::photo_height
      • create_invoice_link_args_t::need_name
      • create_invoice_link_args_t::need_phone_number
      • create_invoice_link_args_t::need_email
      • create_invoice_link_args_t::need_shipping_address
      • create_invoice_link_args_t::send_phone_number_to_provider
      • create_invoice_link_args_t::send_email_to_provider
      • create_invoice_link_args_t::is_flexible
      • create_invoice_link_args_t::business_connection_id