@@ -5316,28 +5316,70 @@ type RevenueWithdrawalState struct {
5316
5316
URL string `json:"url,omitempty"`
5317
5317
}
5318
5318
5319
+ // AffiliateInfo contains information about the affiliate that
5320
+ // received a commission via this transaction.
5321
+ type AffiliateInfo struct {
5322
+ // AffiliateUser is the bot or the user that received an
5323
+ // affiliate commission if it was received by a bot or a user
5324
+ //
5325
+ // optional
5326
+ AffiliateUser * User `json:"affiliate_user,omitempty"`
5327
+ // AffiliateChat is the chat that received an affiliate commission
5328
+ // if it was received by a chat
5329
+ //
5330
+ // optional
5331
+ AffiliateChat * Chat `json:"affiliate_chat,omitempty"`
5332
+ // CommissionPerMile is the number of Telegram Stars received by
5333
+ // the affiliate for each 1000 Telegram Stars received by
5334
+ // the bot from referred users
5335
+ CommissionPerMile int `json:"commission_per_mille"`
5336
+ // Amount is the integer amount of Telegram Stars received by
5337
+ // the affiliate from the transaction, rounded to 0;
5338
+ // can be negative for refunds
5339
+ Amount int64 `json:"amount"`
5340
+ // NanostarAmount is the number of 1/1000000000 shares of Telegram Stars
5341
+ // received by the affiliate; from -999999999 to 999999999;
5342
+ // can be negative for refunds
5343
+ //
5344
+ // optional
5345
+ NanostarAmount int64 `json:"nanostar_amount,omitempty"`
5346
+ }
5347
+
5319
5348
// TransactionPartner describes the source of a transaction, or its recipient for outgoing transactions. Currently, it can be one of
5320
5349
// - TransactionPartnerUser
5350
+ // - TransactionPartnerAffiliateProgram
5321
5351
// - TransactionPartnerFragment
5322
5352
// - TransactionPartnerTelegramAds
5323
5353
// - TransactionPartnerTelegramApi
5324
5354
// - TransactionPartnerOther
5325
5355
type TransactionPartner struct {
5326
5356
// Type of the transaction partner. Must be one of:
5327
- // - fragment
5328
5357
// - user
5329
- // - other
5358
+ // - affiliate_program
5359
+ // - fragment
5330
5360
// - telegram_ads
5331
5361
// - telegram_api
5362
+ // - other
5332
5363
Type string `json:"type"`
5333
- // State of the transaction if the transaction is outgoing.
5334
- // Represent only in "fragment" state
5364
+ // TransactionPartnerUser payload for "user" type of transaction partner
5365
+ TransactionPartnerUser
5366
+ // TransactionPartnerAffiliateProgram payload for "affiliate_program" type of transaction partner
5367
+ TransactionPartnerAffiliateProgram
5368
+ // TransactionPartnerFragment payload for "fragment" type of transaction partner
5369
+ TransactionPartnerFragment
5370
+ // TransactionPartnerTelegramAPI payload for "telegram_api" type of transaction partner
5371
+ TransactionPartnerTelegramAPI
5372
+ }
5373
+
5374
+ type TransactionPartnerUser struct {
5375
+ // Information about the user.
5376
+ User User `json:"user"`
5377
+ // Affiliate is the information about the affiliate that
5378
+ // received a commission via this transaction.
5379
+ // Can be available only for “invoice_payment” and “paid_media_payment” transactions.
5335
5380
//
5336
5381
// optional
5337
- WithdrawalState * RevenueWithdrawalState `json:"withdrawal_state,omitempty"`
5338
- // Information about the user.
5339
- // Represent only in "user" state
5340
- User * User `json:"user,omitempty"`
5382
+ Affiliate * AffiliateInfo `json:"affiliate,omitempty"`
5341
5383
// TransactionPartnerUser only.
5342
5384
// Bot-specified invoice payload
5343
5385
//
@@ -5361,12 +5403,35 @@ type TransactionPartner struct {
5361
5403
//
5362
5404
// optional
5363
5405
Gift * Gift `json:"gift,omitempty"`
5364
- // RequestCount is the number of successful requests that
5365
- // exceeded regular limits and were therefore billed
5366
- // Represent only in "telegram_api" state
5406
+ }
5407
+
5408
+ // TransactionPartnerAffiliateProgram describes the affiliate program that
5409
+ // issued the affiliate commission received via this transaction.
5410
+ type TransactionPartnerAffiliateProgram struct {
5411
+ // SponsorUser is the information about the bot that
5412
+ // sponsored the affiliate program
5367
5413
//
5368
5414
// optional
5369
- RequestCount int `json:"request_count,omitempty"`
5415
+ SponsorUser * User `json:"sponsor_user,omitempty"`
5416
+ // CommissionPerMile is the number of Telegram Stars received by the bot
5417
+ // for each 1000 Telegram Stars received by
5418
+ // the affiliate program sponsor from referred users
5419
+ CommissionPerMile int `json:"commission_per_mille"`
5420
+ }
5421
+
5422
+ // TransactionPartnerFragment describes a withdrawal transaction with Fragment.
5423
+ type TransactionPartnerFragment struct {
5424
+ // State of the transaction if the transaction is outgoing.
5425
+ //
5426
+ // optional
5427
+ WithdrawalState * RevenueWithdrawalState `json:"withdrawal_state,omitempty"`
5428
+ }
5429
+
5430
+ // TransactionPartnerTelegramAPI describes a transaction with payment for paid broadcasting.
5431
+ type TransactionPartnerTelegramAPI struct {
5432
+ // RequestCount is the number of successful requests that
5433
+ // exceeded regular limits and were therefore billed
5434
+ RequestCount int `json:"request_count"`
5370
5435
}
5371
5436
5372
5437
// StarTransaction describes a Telegram Star transaction.
@@ -5377,6 +5442,12 @@ type StarTransaction struct {
5377
5442
ID string `json:"id"`
5378
5443
// Number of Telegram Stars transferred by the transaction
5379
5444
Amount int64 `json:"amount"`
5445
+ // NanostarAmount is the number of 1/1000000000 shares of
5446
+ // Telegram Stars transferred by the transaction;
5447
+ // from 0 to 999999999
5448
+ //
5449
+ // optional
5450
+ NanostarAmount int64 `json:"nanostar_amount,omitempty"`
5380
5451
// Date the transaction was created in Unix time
5381
5452
Date int64 `json:"date"`
5382
5453
// Source of an incoming transaction (e.g., a user purchasing goods or services, Fragment refunding a failed withdrawal).
0 commit comments