Class TransactionPartner

Hierarchy (View Summary)

  • Base
    • TransactionPartner

Constructors

Properties

affiliate?: AffiliateInfo

Information about the affiliate that received a commission via this transaction. Can be available only for “invoice_payment” and “paid_media_payment” transactions.

chat?: Chat

Information about the chat.

commissionRate?: number

The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users.

gift?: string

The gift sent to the user by the bot; for “gift_purchase” transactions only.

paidMedia?: PaidMedia[]

Information about the paid media bought by the user. Can be available only for “invoice_payment” transactions.

paidMediaPayload?: string

Bot-specified paid media payload. Can be available only for “invoice_payment” transactions.

payload?: string

Bot-specified invoice payload. Can be available only for “invoice_payment” transactions.

premiumSubscriptionDuration?: number

Number of months the gifted Telegram Premium subscription will be active for; for “premium_purchase” transactions only

requestCount?: number

The number of successful requests that exceeded regular limits and were therefore billed.

sponsorUser?: User

Information about the bot that sponsored the affiliate program.

subscriptionPeriod?: number

The duration of the paid subscription. Can be available only for “invoice_payment” transactions.

transactionType?:
    | "invoice_payment"
    | "paid_media_payment"
    | "gift_purchase"
    | "premium_purchase"
    | "business_account_transfer"

Type of the transaction, currently one of “invoice_payment” for payments via invoices, “paid_media_payment” for payments for paid media, “gift_purchase” for gifts sent by the bot, “premium_purchase” for Telegram Premium subscriptions gifted by the bot, “business_account_transfer” for direct transfers from managed business accounts

type:
    | "other"
    | "user"
    | "affiliate_program"
    | "fragment"
    | "telegram_api"
    | "telegram_ads"

Type of the transaction partner

user?: User

Information about the user

State of the transaction if the transaction is outgoing

Accessors

Methods

  • Protected

    Creates a clone of the current instance

    Returns Base

    A clone of the current instance

  • Parameters

    • data: TransactionPartner

      Data about the describes the source of a transaction, or its recipient for outgoing transactions

    Returns TransactionPartner

  • Protected

    Updates the current instance with new data and returns a clone of the updated instance

    Parameters

    • data: Record<string, any>

      The data to update the instance with

    Returns Base

    A clone of the updated instance

  • Returns this is TransactionPartner & {
        affiliate?: undefined;
        chat?: undefined;
        commissionRate?: number;
        gift?: undefined;
        paidMedia?: undefined;
        paidMediaPayload?: undefined;
        premiumSubscriptionDuration?: undefined;
        requestCount: undefined;
        sponsorUser?: User;
        subscriptionPeriod?: undefined;
        user?: undefined;
        withdrawal?: undefined;
    }

  • Returns this is TransactionPartner & {
        affiliate?: AffiliateInfo;
        chat: Chat;
        commissionRate?: undefined;
        gift?: Gift;
        paidMedia?: undefined;
        paidMediaPayload?: string;
        premiumSubscriptionDuration?: undefined;
        requestCount?: undefined;
        sponsorUser?: undefined;
        subscriptionPeriod?: number;
        user?: undefined;
        withdrawal?: undefined;
    }

  • Returns this is TransactionPartner & {
        affiliate?: undefined;
        chat?: undefined;
        commissionRate?: undefined;
        gift?: undefined;
        paidMedia?: undefined;
        paidMediaPayload?: undefined;
        premiumSubscriptionDuration?: undefined;
        requestCount?: undefined;
        sponsorUser?: undefined;
        subscriptionPeriod?: undefined;
        user?: undefined;
        withdrawal: RevenueWithdrawalState;
    }

  • Returns this is TransactionPartner & {
        affiliate?: undefined;
        chat?: undefined;
        commissionRate?: undefined;
        gift?: undefined;
        paidMedia?: undefined;
        paidMediaPayload?: undefined;
        premiumSubscriptionDuration?: undefined;
        requestCount: number;
        sponsorUser?: undefined;
        subscriptionPeriod?: undefined;
        user?: undefined;
        withdrawal?: undefined;
    }

  • Returns this is TransactionPartner & {
        affiliate?: AffiliateInfo;
        chat?: undefined;
        commissionRate?: undefined;
        gift?: Gift;
        paidMedia?: PaidMedia[];
        paidMediaPayload?: string;
        premiumSubscriptionDuration?: number;
        requestCount?: undefined;
        sponsorUser?: undefined;
        subscriptionPeriod?: number;
        user: User;
        withdrawal?: undefined;
    }

  • Flatten an object. Any properties that are collections will get converted to an array of keys.

    Parameters

    • OptionalpropsRecursive: boolean

      Optional. If true, calls toJSON method on nested objects.

    • ...props: Record<string, string | boolean>[]

      Optional. Specific properties to include/exclude, or rename.

    Returns Record<string, any>

    Flattened object.

  • Returns the id instance Chat, User, ChatMember and other

    Returns null | string