Link Search Menu Expand Document

Constructor: starsTransaction

Back to constructors index

Represents a Telegram Stars transaction ».

Attributes:

NameTypeRequiredDescription
refundBoolOptionalWhether this transaction is a refund.
pendingBoolOptionalThe transaction is currently pending.
failedBoolOptionalThis transaction has failed.
giftBoolOptionalThis transaction was a gift from the user in peer.peer.
reactionBoolOptionalThis transaction is a paid reaction ».
stargift_upgradeBoolOptional
idstringYesTransaction ID.
starsStarsAmountYesAmount of Stars (negative for outgoing transactions).
dateintYesDate of the transaction (unixtime).
peerStarsTransactionPeerYesSource of the incoming transaction, or its recipient for outgoing transactions.
titlestringOptionalFor transactions with bots, title of the bought product.
descriptionstringOptionalFor transactions with bots, description of the bought product.
photoWebDocumentOptionalFor transactions with bots, photo of the bought product.
transaction_dateintOptionalIf neither pending nor failed are set, the transaction was completed successfully, and this field will contain the point in time (Unix timestamp) when the withdrawal was completed successfully.
transaction_urlstringOptionalIf neither pending nor failed are set, the transaction was completed successfully, and this field will contain a URL where the withdrawal transaction can be viewed.
bot_payloadbytesOptionalBot specified invoice payload (i.e. the payload passed to inputMediaInvoice when creating the invoice).
msg_idintOptionalFor paid media transactions », message ID of the paid media posted to peer.peer (can point to a deleted message; either way, extended_media will always contain the bought media).
extended_mediaArray of MessageMediaOptionalThe purchased paid media ».
subscription_periodintOptionalThe number of seconds between consecutive Telegram Star debiting for Telegram Star subscriptions ».
giveaway_post_idintOptionalID of the message containing the messageMediaGiveaway, for incoming star giveaway prizes.
stargiftStarGiftOptionalThis transaction indicates a purchase or a sale (conversion back to Stars) of a gift ».
floodskip_numberintOptionalThis transaction is payment for paid bot broadcasts.
Paid broadcasts are only allowed if the allow_paid_floodskip parameter of messages.sendMessage and other message sending methods is set while trying to broadcast more than 30 messages per second to bot users.
The integer value returned by this flag indicates the number of billed API calls.
starref_commission_permilleintOptionalThis transaction is the receival (or refund) of an affiliate commission (i.e. this is the transaction received by the peer that created the referral link, flag 17 is for transactions made by users that imported the referral link).
starref_peerPeerOptionalFor transactions made by referred users, the peer that received the affiliate commission.
starref_amountStarsAmountOptionalFor transactions made by referred users, the amount of Telegram Stars received by the affiliate, can be negative for refunds.

Type: StarsTransaction

Example:

$starsTransaction = ['_' => 'starsTransaction', 'refund' => Bool, 'pending' => Bool, 'failed' => Bool, 'gift' => Bool, 'reaction' => Bool, 'stargift_upgrade' => Bool, 'id' => 'string', 'stars' => StarsAmount, 'date' => int, 'peer' => StarsTransactionPeer, 'title' => 'string', 'description' => 'string', 'photo' => WebDocument, 'transaction_date' => int, 'transaction_url' => 'string', 'bot_payload' => 'bytes', 'msg_id' => int, 'extended_media' => [MessageMedia, MessageMedia], 'subscription_period' => int, 'giveaway_post_id' => int, 'stargift' => StarGift, 'floodskip_number' => int, 'starref_commission_permille' => int, 'starref_peer' => Peer, 'starref_amount' => StarsAmount];