Constructor: starsTransaction
Represents a Telegram Stars or TON transaction ».
Attributes:
Name | Type | Required | Description |
---|---|---|---|
refund | Bool | Optional | Whether this transaction is a refund. |
pending | Bool | Optional | The transaction is currently pending. |
failed | Bool | Optional | This transaction has failed. |
gift | Bool | Optional | This transaction was a gift from the user in peer.peer . |
reaction | Bool | Optional | This transaction is a paid reaction ». |
stargift_upgrade | Bool | Optional | This transaction pays for the upgrade of a gift to a collectible gift ». |
business_transfer | Bool | Optional | This transaction transfers stars from the balance of a user account connected to a business bot, to the balance of the business bot, see here » for more info. |
stargift_resale | Bool | Optional | This transaction is related to the resale of a collectible gift ». |
posts_search | Bool | Optional | Represents payment for a paid global post search ». |
stargift_prepaid_upgrade | Bool | Optional | Represents payment for a separate prepaid upgrade of a gift. |
stargift_drop_original_details | Bool | Optional | |
id | string | Yes | Transaction ID. |
amount | StarsAmount | Yes | Amount of Telegram Stars or TON. |
date | int | Yes | Date of the transaction (unixtime). |
peer | StarsTransactionPeer | Yes | Source of the incoming transaction, or its recipient for outgoing transactions. |
title | string | Optional | For transactions with bots, title of the bought product. |
description | string | Optional | For transactions with bots, description of the bought product. |
photo | WebDocument | Optional | For transactions with bots, photo of the bought product. |
transaction_date | int | Optional | If 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_url | string | Optional | If 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_payload | bytes | Optional | Bot specified invoice payload (i.e. the payload passed to inputMediaInvoice when creating the invoice). |
msg_id | int | Optional | For 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_media | Array of MessageMedia | Optional | The purchased paid media ». |
subscription_period | int | Optional | The number of seconds between consecutive Telegram Star debiting for Telegram Star subscriptions ». |
giveaway_post_id | int | Optional | ID of the message containing the messageMediaGiveaway, for incoming star giveaway prizes. |
stargift | StarGift | Optional | This transaction indicates a purchase or a sale (conversion back to Stars) of a gift ». |
floodskip_number | int | Optional | This 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_permille | int | Optional | This 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_peer | Peer | Optional | For transactions made by referred users, the peer that received the affiliate commission. |
starref_amount | StarsAmount | Optional | For transactions made by referred users, the amount of Telegram Stars received by the affiliate, can be negative for refunds. |
paid_messages | int | Optional | This transaction is related to the reception or transmission of a paid message ». |
premium_gift_months | int | Optional | This transaction indicates the payment for a gifted Telegram Premium subscription ». |
ads_proceeds_from_date | int | Optional | Indicates that this is payment for ad revenue from the specified unixtime (always set together with ads_proceeds_to_date). |
ads_proceeds_to_date | int | Optional | Indicates that this is payment for ad revenue to the specified unixtime. |
Type: StarsTransaction
Example:
$starsTransaction = ['_' => 'starsTransaction', 'refund' => Bool, 'pending' => Bool, 'failed' => Bool, 'gift' => Bool, 'reaction' => Bool, 'stargift_upgrade' => Bool, 'business_transfer' => Bool, 'stargift_resale' => Bool, 'posts_search' => Bool, 'stargift_prepaid_upgrade' => Bool, 'stargift_drop_original_details' => Bool, 'id' => 'string', 'amount' => 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, 'paid_messages' => int, 'premium_gift_months' => int, 'ads_proceeds_from_date' => int, 'ads_proceeds_to_date' => int];