Payment objects

SuccessfulPayment

class SuccessfulPayment(currency, total_amount, invoice_payload, telegram_payment_charge_id, provider_payment_charge_id=None, shipping_option_id=None, order_info=None)

This class contains basic information about a successful payment

Parameters
  • currency (str) – Three-letter ISO 4217 currency code

  • total_amount (int) – Total price in the smallest units of the currency (int not float/double)

  • invoice_payload (str) – Bot specified invoice payload

  • telegram_payment_charge_id (str) – Telegram payment identifier

  • provider_payment_charge_id (str) – Provider payment identifier

  • shipping_option_id (str) – Optional: Identifier of the shipping option chosen by the user

  • order_info (OrderInfo) – Optional: Order info provided by the user

Invoice

class Invoice(*, title, description, start_parameter, currency, total_amount)

This class contains basic information about an invoice

Parameters
  • title (str) – Product name

  • description (str) – Product description

  • start_parameter (str) – Unique bot deep.linking parameter that can be used to generate this invoice

  • currency (str) – Three letter ISO 4217 currency code

  • total_amount (int) – Total amount in the smallest units of the currency (int, not float/double)

ShippingQuery

class ShippingQuery(*, id_unique=None, from_user=None, invoice_payload=None, shipping_address=None)

This class contains information about an incoming shipping query

Parameters
  • id_unique (str) – Unique query identifier

  • from_user (User) – User who sent the query

  • invoice_payload (str) – Bot specified invoice payload

  • shipping_address (ShippingAddress) – User specified shipping address

ShippingAddress

class ShippingAddress(*, country_code=None, state=None, city=None, street_line1=None, street_line2=None, post_code=None)

This class represents a shipping address

Parameters
  • country_code (str) – USI 3166-1 alpha-2 country code

  • state (str) – State, if applicable

  • city (str) – City

  • street_line1 (str) – First line for the address

  • street_line2 (str) – Second line for the address

  • post_code (str) – Address post code

PreCheckoutQuery

class PreCheckoutQuery(*, id_unique=None, from_user=None, currency=None, total_amount=None, invoice_payload=None, shipping_option_id=None, order_info=None)

This class contains information about an incoming pre-checkout query

Parameters
  • id_unique (str) – Unique query identifier

  • from_user (User) – User who sent the query

  • currency (str) – Three-letter ISO 4217 currency code

  • total_amount (int) – Total price in the smallest units of the currency (int not float/double)

  • invoice_payload (str) – Bot specified invoice payload

  • shipping_option_id (str) – Optional: Identifier of the shipping option chosen by the user

  • order_info (OrderInfo) – Optional: Order info provided by the user

OrderInfo

class OrderInfo(*, name=None, phone_number=None, email=None, shipping_address=None)

This class represents information about an order

Parameters
  • name (str) – Optional: User name

  • phone_number (str) – Optional: User’s phone number

  • email (str) – Optional: User email

  • shipping_address (ShippingAddress) – Optional: User shipping address