growsurf-ruby 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -0
  3. data/LICENSE +201 -0
  4. data/README.md +1 -1
  5. data/lib/growsurf_ruby/internal/transport/base_client.rb +21 -4
  6. data/lib/growsurf_ruby/models/affiliate_application.rb +249 -0
  7. data/lib/growsurf_ruby/models/affiliate_application_list_response.rb +42 -0
  8. data/lib/growsurf_ruby/models/affiliate_invite.rb +109 -0
  9. data/lib/growsurf_ruby/models/affiliate_invite_list_response.rb +41 -0
  10. data/lib/growsurf_ruby/models/campaign/create.rb +12 -1
  11. data/lib/growsurf_ruby/models/campaign/participant.rb +79 -4
  12. data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +28 -17
  13. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rb +28 -0
  14. data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rb +126 -0
  15. data/lib/growsurf_ruby/models/campaign/participant_list_payouts_params.rb +1 -0
  16. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rb +50 -0
  17. data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rb +56 -0
  18. data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +14 -17
  19. data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +25 -9
  20. data/lib/growsurf_ruby/models/campaign/referral_source.rb +3 -0
  21. data/lib/growsurf_ruby/models/campaign/reward.rb +20 -3
  22. data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +3 -3
  23. data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +3 -3
  24. data/lib/growsurf_ruby/models/campaign.rb +2 -2
  25. data/lib/growsurf_ruby/models/campaign_create_affiliate_invite_params.rb +45 -0
  26. data/lib/growsurf_ruby/models/campaign_list_affiliate_applications_params.rb +57 -0
  27. data/lib/growsurf_ruby/models/campaign_list_affiliate_invites_params.rb +58 -0
  28. data/lib/growsurf_ruby/models/campaign_list_payouts_params.rb +1 -0
  29. data/lib/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rb +26 -0
  30. data/lib/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rb +26 -0
  31. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +9 -6
  32. data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +59 -11
  33. data/lib/growsurf_ruby/models/campaign_review_affiliate_application_params.rb +94 -0
  34. data/lib/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rb +26 -0
  35. data/lib/growsurf_ruby/models/email_analytics.rb +41 -0
  36. data/lib/growsurf_ruby/models/participant_payout_list.rb +8 -1
  37. data/lib/growsurf_ruby/models/reward_tax_valuation.rb +24 -9
  38. data/lib/growsurf_ruby/models.rb +19 -0
  39. data/lib/growsurf_ruby/resources/account.rb +13 -3
  40. data/lib/growsurf_ruby/resources/campaign/commission.rb +3 -2
  41. data/lib/growsurf_ruby/resources/campaign/design.rb +14 -16
  42. data/lib/growsurf_ruby/resources/campaign/emails.rb +9 -11
  43. data/lib/growsurf_ruby/resources/campaign/installation.rb +8 -12
  44. data/lib/growsurf_ruby/resources/campaign/options.rb +11 -13
  45. data/lib/growsurf_ruby/resources/campaign/participant.rb +138 -44
  46. data/lib/growsurf_ruby/resources/campaign/reward.rb +4 -3
  47. data/lib/growsurf_ruby/resources/campaign/rewards.rb +20 -8
  48. data/lib/growsurf_ruby/resources/campaign.rb +245 -15
  49. data/lib/growsurf_ruby/resources/team.rb +22 -13
  50. data/lib/growsurf_ruby/version.rb +1 -1
  51. data/lib/growsurf_ruby.rb +16 -0
  52. data/rbi/growsurf_ruby/models/affiliate_application.rbi +431 -0
  53. data/rbi/growsurf_ruby/models/affiliate_application_list_response.rbi +70 -0
  54. data/rbi/growsurf_ruby/models/affiliate_invite.rbi +167 -0
  55. data/rbi/growsurf_ruby/models/affiliate_invite_list_response.rbi +70 -0
  56. data/rbi/growsurf_ruby/models/campaign/create.rbi +17 -0
  57. data/rbi/growsurf_ruby/models/campaign/participant.rbi +169 -3
  58. data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +3 -5
  59. data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -20
  60. data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +3 -1
  61. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbi +48 -0
  62. data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +243 -0
  63. data/rbi/growsurf_ruby/models/campaign/participant_list_payouts_params.rbi +5 -0
  64. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbi +100 -0
  65. data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +118 -0
  66. data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +22 -52
  67. data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +67 -11
  68. data/rbi/growsurf_ruby/models/campaign/referral_source.rbi +9 -0
  69. data/rbi/growsurf_ruby/models/campaign/reward.rbi +23 -2
  70. data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +4 -4
  71. data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +4 -4
  72. data/rbi/growsurf_ruby/models/campaign.rbi +2 -2
  73. data/rbi/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbi +74 -0
  74. data/rbi/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbi +130 -0
  75. data/rbi/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbi +135 -0
  76. data/rbi/growsurf_ruby/models/campaign_list_payouts_params.rbi +5 -0
  77. data/rbi/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbi +46 -0
  78. data/rbi/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbi +46 -0
  79. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +15 -10
  80. data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +68 -18
  81. data/rbi/growsurf_ruby/models/campaign_review_affiliate_application_params.rbi +167 -0
  82. data/rbi/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbi +46 -0
  83. data/rbi/growsurf_ruby/models/email_analytics.rbi +200 -0
  84. data/rbi/growsurf_ruby/models/participant_payout_list.rbi +17 -3
  85. data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +66 -9
  86. data/rbi/growsurf_ruby/models.rbi +25 -0
  87. data/rbi/growsurf_ruby/resources/account.rbi +14 -0
  88. data/rbi/growsurf_ruby/resources/campaign/commission.rbi +3 -2
  89. data/rbi/growsurf_ruby/resources/campaign/design.rbi +11 -8
  90. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +9 -6
  91. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +8 -8
  92. data/rbi/growsurf_ruby/resources/campaign/options.rbi +11 -8
  93. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +131 -46
  94. data/rbi/growsurf_ruby/resources/campaign/reward.rbi +4 -3
  95. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +22 -10
  96. data/rbi/growsurf_ruby/resources/campaign.rbi +200 -18
  97. data/rbi/growsurf_ruby/resources/team.rbi +23 -0
  98. data/sig/growsurf_ruby/models/affiliate_application.rbs +192 -0
  99. data/sig/growsurf_ruby/models/affiliate_application_list_response.rbs +39 -0
  100. data/sig/growsurf_ruby/models/affiliate_invite.rbs +92 -0
  101. data/sig/growsurf_ruby/models/affiliate_invite_list_response.rbs +39 -0
  102. data/sig/growsurf_ruby/models/campaign/create.rbs +7 -0
  103. data/sig/growsurf_ruby/models/campaign/participant.rbs +62 -2
  104. data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +2 -11
  105. data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +12 -12
  106. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbs +30 -0
  107. data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +107 -0
  108. data/sig/growsurf_ruby/models/campaign/participant_list_payouts_params.rbs +2 -1
  109. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbs +49 -0
  110. data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +57 -0
  111. data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +5 -13
  112. data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +21 -7
  113. data/sig/growsurf_ruby/models/campaign/referral_source.rbs +4 -1
  114. data/sig/growsurf_ruby/models/campaign/reward.rbs +12 -0
  115. data/sig/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbs +40 -0
  116. data/sig/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbs +61 -0
  117. data/sig/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbs +62 -0
  118. data/sig/growsurf_ruby/models/campaign_list_payouts_params.rbs +2 -1
  119. data/sig/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbs +28 -0
  120. data/sig/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbs +28 -0
  121. data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +36 -16
  122. data/sig/growsurf_ruby/models/campaign_review_affiliate_application_params.rbs +79 -0
  123. data/sig/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbs +28 -0
  124. data/sig/growsurf_ruby/models/email_analytics.rbs +92 -0
  125. data/sig/growsurf_ruby/models/participant_payout_list.rbs +12 -4
  126. data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +26 -4
  127. data/sig/growsurf_ruby/models.rbs +18 -0
  128. data/sig/growsurf_ruby/resources/campaign/participant.rbs +16 -2
  129. data/sig/growsurf_ruby/resources/campaign.rbs +53 -0
  130. metadata +54 -3
@@ -4,12 +4,11 @@ module GrowsurfRuby
4
4
  module Resources
5
5
  class Campaign
6
6
  class Options
7
- # Retrieves a program's options configuration — the same surface as the dashboard
8
- # Program Editor's **Options** tab (fraud/reCAPTCHA, tax documentation,
9
- # notification emails, and other program settings).
10
- #
11
- # To see the full object with every field and its current value, `GET` this
12
- # resource, then `PATCH` back only the fields you want to change.
7
+ # Retrieves a program's options — the same surface as the dashboard Program
8
+ # Editor's **Options** tab. Includes reward/fraud approval, anti-fraud lists +
9
+ # toggles, referral cookie/credit windows, reCAPTCHA, affiliate enrollment +
10
+ # application review, payout threshold + tax settings (affiliate only), and
11
+ # notification-email settings. `fraud.recaptcha.secretKey` is never returned.
13
12
  #
14
13
  # @overload retrieve(id, request_options: {})
15
14
  #
@@ -27,13 +26,12 @@ module GrowsurfRuby
27
26
  )
28
27
  end
29
28
 
30
- # Updates a program's options configuration. Only the fields you send are changed;
31
- # anything you leave out is untouched. Unknown fields and invalid values return a
32
- # `400`.
33
- #
34
- # The request body is a partial {CampaignOptions} object. To see the full object
35
- # with every field and its current value, `GET` this resource, then `PATCH` back
36
- # only the fields you want to change.
29
+ # Updates a program's options. Only the fields you send are changed. Some fields
30
+ # are program-type specific (`requireManualRewardApproval`/`autoFulfillRewards`
31
+ # are referral-only; `affiliateApplicationMode`/`affiliateReapplicationPolicy`
32
+ # and `payoutThreshold`/`taxDocumentation` are affiliate-only, and affiliate
33
+ # programs require `requireParticipantAuth: true`). `fraud.recaptcha.secretKey`
34
+ # is write-only. `referralCreditWindowDays: null` means "never expires".
37
35
  #
38
36
  # @overload update(id, body, request_options: {})
39
37
  #
@@ -31,14 +31,20 @@ module GrowsurfRuby
31
31
  )
32
32
  end
33
33
 
34
- # Updates a participant by GrowSurf participant ID or email address.
34
+ # Updates a participant by GrowSurf participant ID or email address. For affiliate
35
+ # programs, set `affiliateStatus` to `APPROVED`, `SUSPENDED`, or `BANNED`.
36
+ # `APPROVED` enrolls the participant as an affiliate. `SUSPENDED` and `BANNED`
37
+ # require an existing affiliate. This endpoint does not accept `isAffiliate`, and
38
+ # affiliate enrollment cannot be removed through REST.
35
39
  #
36
- # @overload update(participant_id_or_email, id:, email: nil, first_name: nil, last_name: nil, metadata: nil, notes: nil, paypal_email: nil, referral_status: nil, referred_by: nil, unsubscribed: nil, vanity_keys: nil, request_options: {})
40
+ # @overload update(participant_id_or_email, id:, affiliate_status: nil, email: nil, first_name: nil, last_name: nil, metadata: nil, notes: nil, referral_status: nil, referred_by: nil, unsubscribed: nil, vanity_keys: nil, request_options: {})
37
41
  #
38
42
  # @param participant_id_or_email [String] Path param: GrowSurf participant ID or URL-encoded participant email address.
39
43
  #
40
44
  # @param id [String] Path param: GrowSurf program ID.
41
45
  #
46
+ # @param affiliate_status [Symbol, GrowsurfRuby::Models::Campaign::ParticipantUpdateParams::AffiliateStatus] Body param: Affiliate programs only. Sets the affiliate status. `APPROVED` also enrolls a participant who is not yet an affiliate. `SUSPENDED` and `BANNED` are rejected for non-affiliates.
47
+ #
42
48
  # @param email [String] Body param
43
49
  #
44
50
  # @param first_name [String] Body param
@@ -49,8 +55,6 @@ module GrowsurfRuby
49
55
  #
50
56
  # @param notes [String] Body param: Freeform internal notes about the participant (internal only, never ex
51
57
  #
52
- # @param paypal_email [String] Body param: The participant's PayPal email address, used for affiliate payouts.
53
- #
54
58
  # @param referral_status [Symbol, GrowsurfRuby::Models::Campaign::ParticipantUpdateParams::ReferralStatus] Body param
55
59
  #
56
60
  # @param referred_by [String] Body param
@@ -110,12 +114,12 @@ module GrowsurfRuby
110
114
  # {GrowsurfRuby::Models::Campaign::ParticipantBulkDeleteParams} for more details.
111
115
  #
112
116
  # Deletes a list of participants from a program in one request. Each entry in
113
- # `participants` is a GrowSurf participant ID or an email address (mixed lists
114
- # are allowed). Up to `200` entries per request — chunk larger lists across
115
- # multiple calls. The response reports a per-row `status` for every submitted
116
- # entry, so a `200` can include rows that were `NOT_FOUND` or failed. Deletion
117
- # is permanent and removes the participants' referrals, rewards, commissions,
118
- # and payout records.
117
+ # `participants` is a GrowSurf participant ID or an email address (mixed lists are
118
+ # allowed). Up to `200` entries per request — chunk larger lists across multiple
119
+ # calls. The response reports a per-row `status` for every submitted entry, so a
120
+ # `200` can include rows that were `NOT_FOUND` or failed. Deletion is permanent
121
+ # and removes the participants' referrals, rewards, commissions, and payout
122
+ # records.
119
123
  #
120
124
  # @overload bulk_delete(id, participants:, request_options: {})
121
125
  #
@@ -143,9 +147,15 @@ module GrowsurfRuby
143
147
  # {GrowsurfRuby::Models::Campaign::ParticipantAddParams} for more details.
144
148
  #
145
149
  # Adds a new participant to the program. If the email already exists, the existing
146
- # participant is returned.
150
+ # participant is returned unchanged. For affiliate programs, set `isAffiliate` to
151
+ # `true` to enroll a new participant as an approved affiliate or `false` to create
152
+ # a non-affiliate. If you omit `isAffiliate`, a valid `referredBy` creates a
153
+ # referred non-affiliate; without a valid referrer, the new participant is enrolled
154
+ # as an approved affiliate. You can send a valid `referredBy` with
155
+ # `isAffiliate: true` to keep the referral attribution and enroll the participant
156
+ # as an affiliate.
147
157
  #
148
- # @overload add(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_by: nil, request_options: {})
158
+ # @overload add(id, email:, fingerprint: nil, first_name: nil, ip_address: nil, is_affiliate: nil, last_name: nil, metadata: nil, mobile_instance_id: nil, referral_status: nil, referred_by: nil, request_options: {})
149
159
  #
150
160
  # @param id [String] GrowSurf program ID.
151
161
  #
@@ -157,6 +167,8 @@ module GrowsurfRuby
157
167
  #
158
168
  # @param ip_address [String]
159
169
  #
170
+ # @param is_affiliate [Boolean] Affiliate programs only. Controls affiliate enrollment for a new participant. `true` enrolls the participant with `affiliateStatus: APPROVED`; `false` creates a non-affiliate without `affiliateStatus`. Existing participants are returned unchanged.
171
+ #
160
172
  # @param last_name [String]
161
173
  #
162
174
  # @param metadata [Hash{Symbol=>Object}] Shallow custom metadata object.
@@ -183,7 +195,8 @@ module GrowsurfRuby
183
195
  )
184
196
  end
185
197
 
186
- # Retrieves a paged list of commissions earned by a participant.
198
+ # **Affiliate programs only.** Retrieves a paged list of commissions earned by a
199
+ # participant.
187
200
  #
188
201
  # @overload list_commissions(participant_id_or_email, id:, limit: nil, next_id: nil, status: nil, request_options: {})
189
202
  #
@@ -218,7 +231,8 @@ module GrowsurfRuby
218
231
  )
219
232
  end
220
233
 
221
- # Retrieves a paged list of payouts that belong to a participant.
234
+ # **Affiliate programs only.** Retrieves a paged list of payouts that belong to a
235
+ # participant.
222
236
  #
223
237
  # @overload list_payouts(participant_id_or_email, id:, limit: nil, next_id: nil, status: nil, request_options: {})
224
238
  #
@@ -339,15 +353,12 @@ module GrowsurfRuby
339
353
  )
340
354
  end
341
355
 
342
- # Records a sale made by a referred customer and generates affiliate commissions
343
- # for their referrer when applicable.
344
- #
345
- # At least one transaction identifier is required: one of +external_id+,
346
- # +transaction_id+, +order_id+, +payment_id+, +invoice_id+, +payment_intent_id+,
347
- # or +charge_id+. +customer_id+ and +subscription_id+ do not count, since they
348
- # identify the customer or subscription rather than the specific transaction.
349
- # Without an identifier, resending the same sale creates a duplicate commission
350
- # and double-pays the referrer; the server rejects such requests with HTTP 400.
356
+ # **Affiliate programs only.** Records a sale made by a referred customer and
357
+ # generates affiliate commissions for their referrer when applicable. Requires at
358
+ # least one transaction identifier (externalId, transactionId, orderId, paymentId,
359
+ # invoiceId, paymentIntentId, or chargeId) so repeated requests can be
360
+ # de-duplicated without one, a resent sale would create a second commission.
361
+ # Reuse the same identifier(s) when refunding.
351
362
  #
352
363
  # @overload record_transaction(participant_id_or_email, id:, currency:, gross_amount:, amount_cash_net: nil, amount_paid: nil, charge_id: nil, customer_id: nil, description: nil, external_id: nil, invoice_id: nil, invoice_subtotal_excluding_tax: nil, invoice_total: nil, invoice_total_excluding_tax: nil, net_amount: nil, order_id: nil, paid_at: nil, payment_id: nil, payment_intent_id: nil, subscription_id: nil, tax_amount: nil, total_tax_amount: nil, total_tax_amounts: nil, total_taxes: nil, transaction_id: nil, request_options: {})
353
364
  #
@@ -421,9 +432,12 @@ module GrowsurfRuby
421
432
  )
422
433
  end
423
434
 
424
- # Records an amendment (refund, partial refund, refund cancellation, or
425
- # chargeback) against a previously recorded transaction and reverses or adjusts
426
- # the referrer's commission.
435
+ # **Affiliate programs only.** Records an amendment (refund, partial refund,
436
+ # refund cancellation, or chargeback) against a previously recorded transaction
437
+ # and reverses or adjusts the referrer's commission. The inverse of Record
438
+ # Affiliate Transaction. Identify the original transaction with the same
439
+ # identifier(s) you sent when recording it. Commissions already paid out to the
440
+ # affiliate are not clawed back; the amendment is recorded for tax reporting only.
427
441
  #
428
442
  # @overload refund_transaction(participant_id_or_email, id:, amendment_type: nil, amount: nil, amount_refunded: nil, charge_id: nil, currency: nil, description: nil, external_id: nil, invoice_id: nil, order_id: nil, payment_id: nil, payment_intent_id: nil, refund_amount: nil, refund_id: nil, refund_status: nil, transaction_id: nil, request_options: {})
429
443
  #
@@ -482,7 +496,7 @@ module GrowsurfRuby
482
496
  end
483
497
 
484
498
  # Sends email invites on behalf of a participant to a list of email addresses.
485
- # Sending invites via the API requires a verified custom email domain on the
499
+ # Sending invites via the API requires a **verified custom email domain** on the
486
500
  # program; the request fails until one is verified.
487
501
  #
488
502
  # @overload send_invites(participant_id_or_email, id:, email_addresses:, message_text:, subject_text:, request_options: {})
@@ -522,7 +536,10 @@ module GrowsurfRuby
522
536
  # details.
523
537
  #
524
538
  # Triggers referral credit for an existing referred participant by GrowSurf
525
- # participant ID or email address.
539
+ # participant ID or email address. Optionally pass `delayInDays` to hold the
540
+ # credit for a number of days before it is awarded (for example, to cover your own
541
+ # refund window). A delayed trigger can be cancelled before it is awarded with the
542
+ # Cancel delayed referral trigger request (DELETE on this same path).
526
543
  #
527
544
  # @overload trigger_referral(participant_id_or_email, id:, delay_in_days: nil, request_options: {})
528
545
  #
@@ -552,8 +569,11 @@ module GrowsurfRuby
552
569
  )
553
570
  end
554
571
 
555
- # Cancels a pending delayed referral trigger for an existing referred participant
556
- # by GrowSurf participant ID or email address.
572
+ # Cancels a pending delayed referral trigger for a participant (the companion to a
573
+ # delayed Trigger referral request). Use this to undo a scheduled referral credit
574
+ # before it is awarded, for example when a refund occurs inside your refund
575
+ # window. If the participant has no pending delayed trigger, `success` is returned
576
+ # as `false`.
557
577
  #
558
578
  # @overload cancel_delayed_referral(participant_id_or_email, id:, request_options: {})
559
579
  #
@@ -580,15 +600,14 @@ module GrowsurfRuby
580
600
  )
581
601
  end
582
602
 
583
- # Sends an email to a participant. Provide EITHER `email_type` to trigger one of the
584
- # program's configured email templates, OR `subject` + `body` for a free-form email.
585
- # Free-form emails are sent with the same compliance handling (company name,
586
- # postal address, and an unsubscribe link are added automatically, and unsubscribed
587
- # participants are suppressed). Sending requires the team to be verified by
588
- # GrowSurf. Requires a verified custom email domain on the program (set up
589
- # in Campaign Editor > 3. Emails > Email Settings). Returns `400` until one is
590
- # verified.
591
- # The email is accepted for delivery.
603
+ # Sends an email to a participant. Provide EITHER `emailType` to trigger one of
604
+ # the program's configured email templates, OR `subject` + `body` for a free-form
605
+ # email. Free-form emails are sent with the same compliance handling (company
606
+ # name, postal address, and an unsubscribe link are added automatically, and
607
+ # unsubscribed participants are suppressed). Sending requires the team to be
608
+ # verified by GrowSurf. Requires a **verified custom email domain** on the program
609
+ # (which can be completed in *Campaign Editor > 3. Emails > Email Settings*).
610
+ # Returns `400` until one is verified. The email is accepted for delivery.
592
611
  #
593
612
  # @overload email(participant_id_or_email, id:, body: nil, email_type: nil, preheader: nil, subject: nil, request_options: {})
594
613
  #
@@ -624,7 +643,8 @@ module GrowsurfRuby
624
643
  )
625
644
  end
626
645
 
627
- # Returns a participant's activity logs, most recent first (offset/limit paginated).
646
+ # Returns a participant's activity logs, most recent first (offset/limit
647
+ # paginated).
628
648
  #
629
649
  # @overload list_activity_logs(participant_id_or_email, id:, limit: nil, offset: nil, request_options: {})
630
650
  #
@@ -662,8 +682,12 @@ module GrowsurfRuby
662
682
  # details.
663
683
  #
664
684
  # Retrieves analytics for a single participant — all-time engagement counters,
665
- # leaderboard ranks, and per-channel share counts (plus affiliate money metrics for
666
- # affiliate programs). Useful for segmenting and re-engaging participants.
685
+ # leaderboard ranks, and per-channel share counts (plus affiliate revenue,
686
+ # commission, and payout metrics for affiliate programs). Pass `include=email`
687
+ # for `sent` (accepted for delivery), `delivered`, `opened`, `clicked`,
688
+ # `bounced`, and `spamComplaints` metrics attributed to this participant,
689
+ # including invitations they sent. Use `include=email,series` to include the
690
+ # same counts in each UTC series bucket.
667
691
  #
668
692
  # @overload retrieve_analytics(participant_id_or_email, id:, days: nil, end_date: nil, include: nil, interval: nil, start_date: nil, request_options: {})
669
693
  #
@@ -675,9 +699,9 @@ module GrowsurfRuby
675
699
  #
676
700
  # @param end_date [Integer] End date of the analytics timeframe as a Unix timestamp in milliseconds. Require
677
701
  #
678
- # @param include [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Include] Set to `series` to also return this participant's own activity per period.
702
+ # @param include [String] Comma-separated optional data. `series` returns this participant's own activity
679
703
  #
680
- # @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used with `include=series`). Defaults to `day`.
704
+ # @param interval [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRetrieveAnalyticsParams::Interval] Bucket size for the `series` (only used when `include` contains `series`).
681
705
  #
682
706
  # @param start_date [Integer] Start date of the analytics timeframe as a Unix timestamp in milliseconds. Requi
683
707
  #
@@ -702,6 +726,76 @@ module GrowsurfRuby
702
726
  )
703
727
  end
704
728
 
729
+ # Returns a participant's payout-destination status across every payout provider
730
+ # enabled for the program (PayPal and/or Wise). For each provider it reports the
731
+ # current status, the confirmed claim email, the legal recipient type, and — when a
732
+ # delivery bounced or a recipient was invalidated — the repair reason.
733
+ # `activeProvider` is the provider that currently gets paid, or `null` until the
734
+ # participant confirms one.
735
+ #
736
+ # @overload get_payout_destination(participant_id_or_email, id:, request_options: {})
737
+ #
738
+ # @param participant_id_or_email [String] Path param: GrowSurf participant ID or URL-encoded participant email address.
739
+ #
740
+ # @param id [String] Path param: GrowSurf program ID.
741
+ #
742
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
743
+ #
744
+ # @return [GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationResponse]
745
+ #
746
+ # @see GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationParams
747
+ def get_payout_destination(participant_id_or_email, params)
748
+ parsed, options = GrowsurfRuby::Campaign::ParticipantGetPayoutDestinationParams.dump_request(params)
749
+ id =
750
+ parsed.delete(:id) do
751
+ raise ArgumentError.new("missing required path argument #{_1}")
752
+ end
753
+ @client.request(
754
+ method: :get,
755
+ path: ["campaign/%1$s/participant/%2$s/payout-destination", id, participant_id_or_email],
756
+ model: GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationResponse,
757
+ options: options
758
+ )
759
+ end
760
+
761
+ # Sends the participant a one-time link to confirm their payout destination for
762
+ # the chosen provider. Only the participant can open the link and confirm — this
763
+ # endpoint just triggers the message. The provider must be enabled for the
764
+ # program.
765
+ #
766
+ # @overload request_payout_destination_confirmation(participant_id_or_email, id:, provider:, request_options: {})
767
+ #
768
+ # @param participant_id_or_email [String] Path param: GrowSurf participant ID or URL-encoded participant email address.
769
+ #
770
+ # @param id [String] Path param: GrowSurf program ID.
771
+ #
772
+ # @param provider [Symbol, GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationParams::Provider] Body param: The payout provider the participant should confirm a destination for.
773
+ #
774
+ # @param request_options [GrowsurfRuby::RequestOptions, Hash{Symbol=>Object}, nil]
775
+ #
776
+ # @return [GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationResponse]
777
+ #
778
+ # @see GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationParams
779
+ def request_payout_destination_confirmation(participant_id_or_email, params)
780
+ parsed, options =
781
+ GrowsurfRuby::Campaign::ParticipantRequestPayoutDestinationConfirmationParams.dump_request(params)
782
+ id =
783
+ parsed.delete(:id) do
784
+ raise ArgumentError.new("missing required path argument #{_1}")
785
+ end
786
+ @client.request(
787
+ method: :post,
788
+ path: [
789
+ "campaign/%1$s/participant/%2$s/payout-destination/request-confirmation",
790
+ id,
791
+ participant_id_or_email
792
+ ],
793
+ body: parsed,
794
+ model: GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationResponse,
795
+ options: options
796
+ )
797
+ end
798
+
705
799
  # @api private
706
800
  #
707
801
  # @param client [GrowsurfRuby::Client]
@@ -33,8 +33,9 @@ module GrowsurfRuby
33
33
  )
34
34
  end
35
35
 
36
- # Approves a manually approved reward earned by a participant. Requires
37
- # `reward:write`. Passing `fulfill: true` also requires `reward:fulfill`.
36
+ # Approves a manually approved reward earned by a participant. This requires
37
+ # `reward:write`. When the request also sets `fulfill` to `true`, it additionally
38
+ # requires `reward:fulfill`.
38
39
  #
39
40
  # @overload approve(reward_id, id:, fulfill: nil, request_options: {})
40
41
  #
@@ -64,7 +65,7 @@ module GrowsurfRuby
64
65
  )
65
66
  end
66
67
 
67
- # Marks an approved participant reward as fulfilled. Requires `reward:fulfill`.
68
+ # Marks an approved participant reward as fulfilled.
68
69
  #
69
70
  # @overload fulfill(reward_id, id:, request_options: {})
70
71
  #
@@ -4,7 +4,9 @@ module GrowsurfRuby
4
4
  module Resources
5
5
  class Campaign
6
6
  class Rewards
7
- # Retrieves the rewards configured for a program.
7
+ # Retrieves the list of a program's configured rewards (`CampaignReward`s) — the
8
+ # same set embedded in the `rewards` array of the campaign response. Delete a
9
+ # reward with `DELETE /campaign/{id}/reward-configs/{campaignRewardId}`.
8
10
  #
9
11
  # @overload list(id, request_options: {})
10
12
  #
@@ -22,8 +24,11 @@ module GrowsurfRuby
22
24
  )
23
25
  end
24
26
 
25
- # Creates a reward for a program. The reward `type` must be compatible with the
26
- # program type.
27
+ # Creates a new campaign reward (`CampaignReward`) with a GrowSurf-assigned ID.
28
+ # The reward type must be compatible with the program type (affiliate programs
29
+ # support only `AFFILIATE` rewards; referral programs support all other types).
30
+ # Enabling an active reward of a type automatically enables that reward type on
31
+ # the program.
27
32
  #
28
33
  # @overload create(id, type:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
29
34
  #
@@ -65,7 +70,7 @@ module GrowsurfRuby
65
70
  #
66
71
  # @param referred_reward_upfront [Boolean] Body param
67
72
  #
68
- # @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax valuation for the referred friend's side of a double-sided rewa
73
+ # @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax treatment override for the referred friend's side of a double-sided rewa
69
74
  #
70
75
  # @param title [String] Body param
71
76
  #
@@ -87,8 +92,11 @@ module GrowsurfRuby
87
92
  )
88
93
  end
89
94
 
90
- # Updates an existing campaign reward. Only the fields you send are changed;
91
- # `type` is immutable and must not be supplied.
95
+ # Updates an existing campaign reward (`CampaignReward`). The reward `type` is
96
+ # immutable and cannot be changed. When the update replaces `metadata`, renamed
97
+ # keys automatically rewrite any `{{campaignReward[…]}}` references in campaign
98
+ # copy; removing a key that campaign copy still references returns a `409` listing
99
+ # the referencing fields.
92
100
  #
93
101
  # @overload update(campaign_reward_id, id:, commission_structure: nil, conversions_required: nil, coupon_code: nil, description: nil, image_url: nil, is_unlimited: nil, is_visible: nil, limit: nil, limit_duration: nil, metadata: nil, next_milestone_prefix: nil, next_milestone_suffix: nil, number_of_winners: nil, order: nil, referral_coupon_code: nil, referral_description: nil, referred_reward_upfront: nil, referred_value: nil, title: nil, value: nil, request_options: {})
94
102
  #
@@ -130,7 +138,7 @@ module GrowsurfRuby
130
138
  #
131
139
  # @param referred_reward_upfront [Boolean] Body param
132
140
  #
133
- # @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax valuation for the referred friend's side of a double-sided rewa
141
+ # @param referred_value [GrowsurfRuby::Models::RewardTaxValuation] Body param: Tax treatment override for the referred friend's side of a double-sided rewa
134
142
  #
135
143
  # @param title [String] Body param
136
144
  #
@@ -156,7 +164,11 @@ module GrowsurfRuby
156
164
  )
157
165
  end
158
166
 
159
- # Deletes a campaign reward.
167
+ # Deletes a campaign reward (`CampaignReward`). The reward is deactivated, removed
168
+ # from the program's reward set, and any connected upfront-discount coupons are
169
+ # cleaned up. If campaign copy still references any of the reward's metadata keys
170
+ # via `{{campaignReward[…]}}` tokens, the delete returns a `409` listing the
171
+ # referencing fields — update those fields first.
160
172
  #
161
173
  # @overload delete(campaign_reward_id, id:, request_options: {})
162
174
  #