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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/LICENSE +201 -0
- data/README.md +1 -1
- data/lib/growsurf_ruby/internal/transport/base_client.rb +21 -4
- data/lib/growsurf_ruby/models/affiliate_application.rb +249 -0
- data/lib/growsurf_ruby/models/affiliate_application_list_response.rb +42 -0
- data/lib/growsurf_ruby/models/affiliate_invite.rb +109 -0
- data/lib/growsurf_ruby/models/affiliate_invite_list_response.rb +41 -0
- data/lib/growsurf_ruby/models/campaign/create.rb +12 -1
- data/lib/growsurf_ruby/models/campaign/participant.rb +79 -4
- data/lib/growsurf_ruby/models/campaign/participant_analytics_response.rb +28 -17
- data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rb +28 -0
- data/lib/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rb +126 -0
- data/lib/growsurf_ruby/models/campaign/participant_list_payouts_params.rb +1 -0
- data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rb +50 -0
- data/lib/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rb +56 -0
- data/lib/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rb +14 -17
- data/lib/growsurf_ruby/models/campaign/participant_update_params.rb +25 -9
- data/lib/growsurf_ruby/models/campaign/referral_source.rb +3 -0
- data/lib/growsurf_ruby/models/campaign/reward.rb +20 -3
- data/lib/growsurf_ruby/models/campaign/reward_create_params.rb +3 -3
- data/lib/growsurf_ruby/models/campaign/reward_update_params.rb +3 -3
- data/lib/growsurf_ruby/models/campaign.rb +2 -2
- data/lib/growsurf_ruby/models/campaign_create_affiliate_invite_params.rb +45 -0
- data/lib/growsurf_ruby/models/campaign_list_affiliate_applications_params.rb +57 -0
- data/lib/growsurf_ruby/models/campaign_list_affiliate_invites_params.rb +58 -0
- data/lib/growsurf_ruby/models/campaign_list_payouts_params.rb +1 -0
- data/lib/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rb +26 -0
- data/lib/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rb +26 -0
- data/lib/growsurf_ruby/models/campaign_retrieve_analytics_params.rb +9 -6
- data/lib/growsurf_ruby/models/campaign_retrieve_analytics_response.rb +59 -11
- data/lib/growsurf_ruby/models/campaign_review_affiliate_application_params.rb +94 -0
- data/lib/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rb +26 -0
- data/lib/growsurf_ruby/models/email_analytics.rb +41 -0
- data/lib/growsurf_ruby/models/participant_payout_list.rb +8 -1
- data/lib/growsurf_ruby/models/reward_tax_valuation.rb +24 -9
- data/lib/growsurf_ruby/models.rb +19 -0
- data/lib/growsurf_ruby/resources/account.rb +13 -3
- data/lib/growsurf_ruby/resources/campaign/commission.rb +3 -2
- data/lib/growsurf_ruby/resources/campaign/design.rb +14 -16
- data/lib/growsurf_ruby/resources/campaign/emails.rb +9 -11
- data/lib/growsurf_ruby/resources/campaign/installation.rb +8 -12
- data/lib/growsurf_ruby/resources/campaign/options.rb +11 -13
- data/lib/growsurf_ruby/resources/campaign/participant.rb +138 -44
- data/lib/growsurf_ruby/resources/campaign/reward.rb +4 -3
- data/lib/growsurf_ruby/resources/campaign/rewards.rb +20 -8
- data/lib/growsurf_ruby/resources/campaign.rb +245 -15
- data/lib/growsurf_ruby/resources/team.rb +22 -13
- data/lib/growsurf_ruby/version.rb +1 -1
- data/lib/growsurf_ruby.rb +16 -0
- data/rbi/growsurf_ruby/models/affiliate_application.rbi +431 -0
- data/rbi/growsurf_ruby/models/affiliate_application_list_response.rbi +70 -0
- data/rbi/growsurf_ruby/models/affiliate_invite.rbi +167 -0
- data/rbi/growsurf_ruby/models/affiliate_invite_list_response.rbi +70 -0
- data/rbi/growsurf_ruby/models/campaign/create.rbi +17 -0
- data/rbi/growsurf_ruby/models/campaign/participant.rbi +169 -3
- data/rbi/growsurf_ruby/models/campaign/participant_activity_logs_response.rbi +3 -5
- data/rbi/growsurf_ruby/models/campaign/participant_analytics_response.rbi +35 -20
- data/rbi/growsurf_ruby/models/campaign/participant_bulk_delete_response.rbi +3 -1
- data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbi +48 -0
- data/rbi/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbi +243 -0
- data/rbi/growsurf_ruby/models/campaign/participant_list_payouts_params.rbi +5 -0
- data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbi +100 -0
- data/rbi/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbi +118 -0
- data/rbi/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbi +22 -52
- data/rbi/growsurf_ruby/models/campaign/participant_update_params.rbi +67 -11
- data/rbi/growsurf_ruby/models/campaign/referral_source.rbi +9 -0
- data/rbi/growsurf_ruby/models/campaign/reward.rbi +23 -2
- data/rbi/growsurf_ruby/models/campaign/reward_create_params.rbi +4 -4
- data/rbi/growsurf_ruby/models/campaign/reward_update_params.rbi +4 -4
- data/rbi/growsurf_ruby/models/campaign.rbi +2 -2
- data/rbi/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbi +74 -0
- data/rbi/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbi +130 -0
- data/rbi/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbi +135 -0
- data/rbi/growsurf_ruby/models/campaign_list_payouts_params.rbi +5 -0
- data/rbi/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbi +46 -0
- data/rbi/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbi +46 -0
- data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_params.rbi +15 -10
- data/rbi/growsurf_ruby/models/campaign_retrieve_analytics_response.rbi +68 -18
- data/rbi/growsurf_ruby/models/campaign_review_affiliate_application_params.rbi +167 -0
- data/rbi/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbi +46 -0
- data/rbi/growsurf_ruby/models/email_analytics.rbi +200 -0
- data/rbi/growsurf_ruby/models/participant_payout_list.rbi +17 -3
- data/rbi/growsurf_ruby/models/reward_tax_valuation.rbi +66 -9
- data/rbi/growsurf_ruby/models.rbi +25 -0
- data/rbi/growsurf_ruby/resources/account.rbi +14 -0
- data/rbi/growsurf_ruby/resources/campaign/commission.rbi +3 -2
- data/rbi/growsurf_ruby/resources/campaign/design.rbi +11 -8
- data/rbi/growsurf_ruby/resources/campaign/emails.rbi +9 -6
- data/rbi/growsurf_ruby/resources/campaign/installation.rbi +8 -8
- data/rbi/growsurf_ruby/resources/campaign/options.rbi +11 -8
- data/rbi/growsurf_ruby/resources/campaign/participant.rbi +131 -46
- data/rbi/growsurf_ruby/resources/campaign/reward.rbi +4 -3
- data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +22 -10
- data/rbi/growsurf_ruby/resources/campaign.rbi +200 -18
- data/rbi/growsurf_ruby/resources/team.rbi +23 -0
- data/sig/growsurf_ruby/models/affiliate_application.rbs +192 -0
- data/sig/growsurf_ruby/models/affiliate_application_list_response.rbs +39 -0
- data/sig/growsurf_ruby/models/affiliate_invite.rbs +92 -0
- data/sig/growsurf_ruby/models/affiliate_invite_list_response.rbs +39 -0
- data/sig/growsurf_ruby/models/campaign/create.rbs +7 -0
- data/sig/growsurf_ruby/models/campaign/participant.rbs +62 -2
- data/sig/growsurf_ruby/models/campaign/participant_activity_logs_response.rbs +2 -11
- data/sig/growsurf_ruby/models/campaign/participant_analytics_response.rbs +12 -12
- data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_params.rbs +30 -0
- data/sig/growsurf_ruby/models/campaign/participant_get_payout_destination_response.rbs +107 -0
- data/sig/growsurf_ruby/models/campaign/participant_list_payouts_params.rbs +2 -1
- data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_params.rbs +49 -0
- data/sig/growsurf_ruby/models/campaign/participant_request_payout_destination_confirmation_response.rbs +57 -0
- data/sig/growsurf_ruby/models/campaign/participant_retrieve_analytics_params.rbs +5 -13
- data/sig/growsurf_ruby/models/campaign/participant_update_params.rbs +21 -7
- data/sig/growsurf_ruby/models/campaign/referral_source.rbs +4 -1
- data/sig/growsurf_ruby/models/campaign/reward.rbs +12 -0
- data/sig/growsurf_ruby/models/campaign_create_affiliate_invite_params.rbs +40 -0
- data/sig/growsurf_ruby/models/campaign_list_affiliate_applications_params.rbs +61 -0
- data/sig/growsurf_ruby/models/campaign_list_affiliate_invites_params.rbs +62 -0
- data/sig/growsurf_ruby/models/campaign_list_payouts_params.rbs +2 -1
- data/sig/growsurf_ruby/models/campaign_resend_affiliate_invite_params.rbs +28 -0
- data/sig/growsurf_ruby/models/campaign_retrieve_affiliate_application_params.rbs +28 -0
- data/sig/growsurf_ruby/models/campaign_retrieve_analytics_response.rbs +36 -16
- data/sig/growsurf_ruby/models/campaign_review_affiliate_application_params.rbs +79 -0
- data/sig/growsurf_ruby/models/campaign_revoke_affiliate_invite_params.rbs +28 -0
- data/sig/growsurf_ruby/models/email_analytics.rbs +92 -0
- data/sig/growsurf_ruby/models/participant_payout_list.rbs +12 -4
- data/sig/growsurf_ruby/models/reward_tax_valuation.rbs +26 -4
- data/sig/growsurf_ruby/models.rbs +18 -0
- data/sig/growsurf_ruby/resources/campaign/participant.rbs +16 -2
- data/sig/growsurf_ruby/resources/campaign.rbs +53 -0
- metadata +54 -3
|
@@ -21,17 +21,22 @@ module GrowsurfRuby
|
|
|
21
21
|
)
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
# Updates a participant by GrowSurf participant ID or email address.
|
|
24
|
+
# Updates a participant by GrowSurf participant ID or email address. For affiliate
|
|
25
|
+
# programs, set `affiliateStatus` to `APPROVED`, `SUSPENDED`, or `BANNED`.
|
|
26
|
+
# `APPROVED` enrolls the participant as an affiliate. `SUSPENDED` and `BANNED`
|
|
27
|
+
# require an existing affiliate. This endpoint does not accept `isAffiliate`, and
|
|
28
|
+
# affiliate enrollment cannot be removed through REST.
|
|
25
29
|
sig do
|
|
26
30
|
params(
|
|
27
31
|
participant_id_or_email: String,
|
|
28
32
|
id: String,
|
|
33
|
+
affiliate_status:
|
|
34
|
+
GrowsurfRuby::Campaign::ParticipantUpdateParams::AffiliateStatus::OrSymbol,
|
|
29
35
|
email: String,
|
|
30
36
|
first_name: String,
|
|
31
37
|
last_name: String,
|
|
32
38
|
metadata: T::Hash[Symbol, T.anything],
|
|
33
39
|
notes: String,
|
|
34
|
-
paypal_email: String,
|
|
35
40
|
referral_status:
|
|
36
41
|
GrowsurfRuby::Campaign::ParticipantUpdateParams::ReferralStatus::OrSymbol,
|
|
37
42
|
referred_by: String,
|
|
@@ -45,6 +50,10 @@ module GrowsurfRuby
|
|
|
45
50
|
participant_id_or_email,
|
|
46
51
|
# Path param: GrowSurf program ID.
|
|
47
52
|
id:,
|
|
53
|
+
# Body param: Affiliate programs only. Sets the affiliate status. `APPROVED` also
|
|
54
|
+
# enrolls a participant who is not yet an affiliate. `SUSPENDED` and `BANNED`
|
|
55
|
+
# are rejected for non-affiliates.
|
|
56
|
+
affiliate_status: nil,
|
|
48
57
|
# Body param
|
|
49
58
|
email: nil,
|
|
50
59
|
# Body param
|
|
@@ -56,8 +65,6 @@ module GrowsurfRuby
|
|
|
56
65
|
# Body param: Freeform internal notes about the participant (internal only, never
|
|
57
66
|
# exposed to participants).
|
|
58
67
|
notes: nil,
|
|
59
|
-
# Body param: The participant's PayPal email address, used for affiliate payouts.
|
|
60
|
-
paypal_email: nil,
|
|
61
68
|
# Body param
|
|
62
69
|
referral_status: nil,
|
|
63
70
|
# Body param
|
|
@@ -88,12 +95,12 @@ module GrowsurfRuby
|
|
|
88
95
|
end
|
|
89
96
|
|
|
90
97
|
# Deletes a list of participants from a program in one request. Each entry in
|
|
91
|
-
# `participants` is a GrowSurf participant ID or an email address (mixed lists
|
|
92
|
-
#
|
|
93
|
-
#
|
|
94
|
-
#
|
|
95
|
-
#
|
|
96
|
-
#
|
|
98
|
+
# `participants` is a GrowSurf participant ID or an email address (mixed lists are
|
|
99
|
+
# allowed). Up to `200` entries per request — chunk larger lists across multiple
|
|
100
|
+
# calls. The response reports a per-row `status` for every submitted entry, so a
|
|
101
|
+
# `200` can include rows that were `NOT_FOUND` or failed. Deletion is permanent
|
|
102
|
+
# and removes the participants' referrals, rewards, commissions, and payout
|
|
103
|
+
# records.
|
|
97
104
|
sig do
|
|
98
105
|
params(
|
|
99
106
|
id: String,
|
|
@@ -114,7 +121,13 @@ module GrowsurfRuby
|
|
|
114
121
|
end
|
|
115
122
|
|
|
116
123
|
# Adds a new participant to the program. If the email already exists, the existing
|
|
117
|
-
# participant is returned.
|
|
124
|
+
# participant is returned unchanged. For affiliate programs, set `isAffiliate` to
|
|
125
|
+
# `true` to enroll a new participant as an approved affiliate or `false` to create
|
|
126
|
+
# a non-affiliate. If you omit `isAffiliate`, a valid `referredBy` creates a
|
|
127
|
+
# referred non-affiliate; without a valid referrer, the new participant is enrolled
|
|
128
|
+
# as an approved affiliate. You can send a valid `referredBy` with
|
|
129
|
+
# `isAffiliate: true` to keep the referral attribution and enroll the participant
|
|
130
|
+
# as an affiliate.
|
|
118
131
|
sig do
|
|
119
132
|
params(
|
|
120
133
|
id: String,
|
|
@@ -122,6 +135,7 @@ module GrowsurfRuby
|
|
|
122
135
|
fingerprint: String,
|
|
123
136
|
first_name: String,
|
|
124
137
|
ip_address: String,
|
|
138
|
+
is_affiliate: T::Boolean,
|
|
125
139
|
last_name: String,
|
|
126
140
|
metadata: T::Hash[Symbol, T.anything],
|
|
127
141
|
mobile_instance_id: String,
|
|
@@ -138,6 +152,11 @@ module GrowsurfRuby
|
|
|
138
152
|
fingerprint: nil,
|
|
139
153
|
first_name: nil,
|
|
140
154
|
ip_address: nil,
|
|
155
|
+
# Affiliate programs only. Controls affiliate enrollment for a new participant.
|
|
156
|
+
# `true` enrolls the participant with `affiliateStatus: APPROVED`; `false`
|
|
157
|
+
# creates a non-affiliate without `affiliateStatus`. Existing participants are
|
|
158
|
+
# returned unchanged.
|
|
159
|
+
is_affiliate: nil,
|
|
141
160
|
last_name: nil,
|
|
142
161
|
# Shallow custom metadata object.
|
|
143
162
|
metadata: nil,
|
|
@@ -156,7 +175,8 @@ module GrowsurfRuby
|
|
|
156
175
|
)
|
|
157
176
|
end
|
|
158
177
|
|
|
159
|
-
# Retrieves a paged list of commissions earned by a
|
|
178
|
+
# **Affiliate programs only.** Retrieves a paged list of commissions earned by a
|
|
179
|
+
# participant.
|
|
160
180
|
sig do
|
|
161
181
|
params(
|
|
162
182
|
participant_id_or_email: String,
|
|
@@ -183,7 +203,8 @@ module GrowsurfRuby
|
|
|
183
203
|
)
|
|
184
204
|
end
|
|
185
205
|
|
|
186
|
-
# Retrieves a paged list of payouts that belong to a
|
|
206
|
+
# **Affiliate programs only.** Retrieves a paged list of payouts that belong to a
|
|
207
|
+
# participant.
|
|
187
208
|
sig do
|
|
188
209
|
params(
|
|
189
210
|
participant_id_or_email: String,
|
|
@@ -280,15 +301,12 @@ module GrowsurfRuby
|
|
|
280
301
|
)
|
|
281
302
|
end
|
|
282
303
|
|
|
283
|
-
# Records a sale made by a referred customer and
|
|
284
|
-
# for their referrer when applicable.
|
|
285
|
-
#
|
|
286
|
-
#
|
|
287
|
-
#
|
|
288
|
-
#
|
|
289
|
-
# identify the customer or subscription rather than the specific transaction.
|
|
290
|
-
# Without an identifier, resending the same sale creates a duplicate commission
|
|
291
|
-
# and double-pays the referrer; the server rejects such requests with HTTP 400.
|
|
304
|
+
# **Affiliate programs only.** Records a sale made by a referred customer and
|
|
305
|
+
# generates affiliate commissions for their referrer when applicable. Requires at
|
|
306
|
+
# least one transaction identifier (externalId, transactionId, orderId, paymentId,
|
|
307
|
+
# invoiceId, paymentIntentId, or chargeId) so repeated requests can be
|
|
308
|
+
# de-duplicated — without one, a resent sale would create a second commission.
|
|
309
|
+
# Reuse the same identifier(s) when refunding.
|
|
292
310
|
sig do
|
|
293
311
|
params(
|
|
294
312
|
participant_id_or_email: String,
|
|
@@ -376,9 +394,12 @@ module GrowsurfRuby
|
|
|
376
394
|
)
|
|
377
395
|
end
|
|
378
396
|
|
|
379
|
-
# Records an amendment (refund, partial refund,
|
|
380
|
-
# chargeback) against a previously recorded transaction
|
|
381
|
-
# the referrer's commission.
|
|
397
|
+
# **Affiliate programs only.** Records an amendment (refund, partial refund,
|
|
398
|
+
# refund cancellation, or chargeback) against a previously recorded transaction
|
|
399
|
+
# and reverses or adjusts the referrer's commission. The inverse of Record
|
|
400
|
+
# Affiliate Transaction. Identify the original transaction with the same
|
|
401
|
+
# identifier(s) you sent when recording it. Commissions already paid out to the
|
|
402
|
+
# affiliate are not clawed back; the amendment is recorded for tax reporting only.
|
|
382
403
|
sig do
|
|
383
404
|
params(
|
|
384
405
|
participant_id_or_email: String,
|
|
@@ -444,7 +465,7 @@ module GrowsurfRuby
|
|
|
444
465
|
end
|
|
445
466
|
|
|
446
467
|
# Sends email invites on behalf of a participant to a list of email addresses.
|
|
447
|
-
# Sending invites via the API requires a verified custom email domain on the
|
|
468
|
+
# Sending invites via the API requires a **verified custom email domain** on the
|
|
448
469
|
# program; the request fails until one is verified.
|
|
449
470
|
sig do
|
|
450
471
|
params(
|
|
@@ -474,7 +495,10 @@ module GrowsurfRuby
|
|
|
474
495
|
end
|
|
475
496
|
|
|
476
497
|
# Triggers referral credit for an existing referred participant by GrowSurf
|
|
477
|
-
# participant ID or email address.
|
|
498
|
+
# participant ID or email address. Optionally pass `delayInDays` to hold the
|
|
499
|
+
# credit for a number of days before it is awarded (for example, to cover your own
|
|
500
|
+
# refund window). A delayed trigger can be cancelled before it is awarded with the
|
|
501
|
+
# Cancel delayed referral trigger request (DELETE on this same path).
|
|
478
502
|
sig do
|
|
479
503
|
params(
|
|
480
504
|
participant_id_or_email: String,
|
|
@@ -500,8 +524,11 @@ module GrowsurfRuby
|
|
|
500
524
|
)
|
|
501
525
|
end
|
|
502
526
|
|
|
503
|
-
# Cancels a pending delayed referral trigger for
|
|
504
|
-
#
|
|
527
|
+
# Cancels a pending delayed referral trigger for a participant (the companion to a
|
|
528
|
+
# delayed Trigger referral request). Use this to undo a scheduled referral credit
|
|
529
|
+
# before it is awarded, for example when a refund occurs inside your refund
|
|
530
|
+
# window. If the participant has no pending delayed trigger, `success` is returned
|
|
531
|
+
# as `false`.
|
|
505
532
|
sig do
|
|
506
533
|
params(
|
|
507
534
|
participant_id_or_email: String,
|
|
@@ -520,15 +547,14 @@ module GrowsurfRuby
|
|
|
520
547
|
)
|
|
521
548
|
end
|
|
522
549
|
|
|
523
|
-
# Sends an email to a participant. Provide EITHER `
|
|
524
|
-
# program's configured email templates, OR `subject` + `body` for a free-form
|
|
525
|
-
# Free-form emails are sent with the same compliance handling (company
|
|
526
|
-
# postal address, and an unsubscribe link are added automatically, and
|
|
527
|
-
# participants are suppressed). Sending requires the team to be
|
|
528
|
-
# GrowSurf. Requires a verified custom email domain on the program
|
|
529
|
-
# in Campaign Editor > 3. Emails > Email Settings).
|
|
530
|
-
# verified.
|
|
531
|
-
# The email is accepted for delivery.
|
|
550
|
+
# Sends an email to a participant. Provide EITHER `emailType` to trigger one of
|
|
551
|
+
# the program's configured email templates, OR `subject` + `body` for a free-form
|
|
552
|
+
# email. Free-form emails are sent with the same compliance handling (company
|
|
553
|
+
# name, postal address, and an unsubscribe link are added automatically, and
|
|
554
|
+
# unsubscribed participants are suppressed). Sending requires the team to be
|
|
555
|
+
# verified by GrowSurf. Requires a **verified custom email domain** on the program
|
|
556
|
+
# (which can be completed in *Campaign Editor > 3. Emails > Email Settings*).
|
|
557
|
+
# Returns `400` until one is verified. The email is accepted for delivery.
|
|
532
558
|
sig do
|
|
533
559
|
params(
|
|
534
560
|
participant_id_or_email: String,
|
|
@@ -569,7 +595,8 @@ module GrowsurfRuby
|
|
|
569
595
|
)
|
|
570
596
|
end
|
|
571
597
|
|
|
572
|
-
# Returns a participant's activity logs, most recent first (offset/limit
|
|
598
|
+
# Returns a participant's activity logs, most recent first (offset/limit
|
|
599
|
+
# paginated).
|
|
573
600
|
sig do
|
|
574
601
|
params(
|
|
575
602
|
participant_id_or_email: String,
|
|
@@ -594,17 +621,19 @@ module GrowsurfRuby
|
|
|
594
621
|
)
|
|
595
622
|
end
|
|
596
623
|
|
|
597
|
-
# Retrieves analytics for a single participant — all-time engagement counters,
|
|
598
|
-
#
|
|
599
|
-
# affiliate programs).
|
|
624
|
+
# Retrieves analytics for a single participant — all-time engagement counters, leaderboard
|
|
625
|
+
# ranks, and per-channel share counts (plus affiliate revenue, commission, and payout
|
|
626
|
+
# metrics for affiliate programs). Pass `include=email` for `sent` (accepted for
|
|
627
|
+
# delivery), `delivered`, `opened`, `clicked`, `bounced`, and `spamComplaints` metrics
|
|
628
|
+
# attributed to this participant, including invitations they sent. Use
|
|
629
|
+
# `include=email,series` to include the same counts in each UTC series bucket.
|
|
600
630
|
sig do
|
|
601
631
|
params(
|
|
602
632
|
participant_id_or_email: String,
|
|
603
633
|
id: String,
|
|
604
634
|
days: Integer,
|
|
605
635
|
end_date: Integer,
|
|
606
|
-
include:
|
|
607
|
-
GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Include::OrSymbol,
|
|
636
|
+
include: String,
|
|
608
637
|
interval:
|
|
609
638
|
GrowsurfRuby::Campaign::ParticipantRetrieveAnalyticsParams::Interval::OrSymbol,
|
|
610
639
|
start_date: Integer,
|
|
@@ -623,9 +652,15 @@ module GrowsurfRuby
|
|
|
623
652
|
# End date of the analytics timeframe as a Unix timestamp in milliseconds.
|
|
624
653
|
# Required if `days` is not set.
|
|
625
654
|
end_date: nil,
|
|
626
|
-
#
|
|
655
|
+
# Comma-separated optional data. `series` returns this participant's own activity per
|
|
656
|
+
# period; `email` returns `sent`, `delivered`, `opened`, `clicked`, `bounced`,
|
|
657
|
+
# `spamComplaints`, and per-email-type metrics attributed to the participant for the
|
|
658
|
+
# requested analytics window (including invitations they sent). Request both in either
|
|
659
|
+
# order to add email counts to every series item for emails sent during that period.
|
|
660
|
+
# Only documented tokens are accepted; an unknown token returns `400`.
|
|
627
661
|
include: nil,
|
|
628
|
-
# Bucket size for the `series` (only used
|
|
662
|
+
# Bucket size for the `series` (only used when `include` contains `series`). Defaults to
|
|
663
|
+
# `day`.
|
|
629
664
|
interval: nil,
|
|
630
665
|
# Start date of the analytics timeframe as a Unix timestamp in milliseconds.
|
|
631
666
|
# Required if `days` is not set.
|
|
@@ -634,6 +669,56 @@ module GrowsurfRuby
|
|
|
634
669
|
)
|
|
635
670
|
end
|
|
636
671
|
|
|
672
|
+
# Returns a participant's payout-destination status across every payout provider
|
|
673
|
+
# enabled for the program (PayPal and/or Wise). For each provider it reports the
|
|
674
|
+
# current status, the confirmed claim email, the legal recipient type, and — when a
|
|
675
|
+
# delivery bounced or a recipient was invalidated — the repair reason.
|
|
676
|
+
# `activeProvider` is the provider that currently gets paid, or `null` until the
|
|
677
|
+
# participant confirms one.
|
|
678
|
+
sig do
|
|
679
|
+
params(
|
|
680
|
+
participant_id_or_email: String,
|
|
681
|
+
id: String,
|
|
682
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
683
|
+
).returns(
|
|
684
|
+
GrowsurfRuby::Models::Campaign::ParticipantGetPayoutDestinationResponse
|
|
685
|
+
)
|
|
686
|
+
end
|
|
687
|
+
def get_payout_destination(
|
|
688
|
+
# GrowSurf participant ID or URL-encoded participant email address.
|
|
689
|
+
participant_id_or_email,
|
|
690
|
+
# GrowSurf program ID.
|
|
691
|
+
id:,
|
|
692
|
+
request_options: {}
|
|
693
|
+
)
|
|
694
|
+
end
|
|
695
|
+
|
|
696
|
+
# Sends the participant a one-time link to confirm their payout destination for
|
|
697
|
+
# the chosen provider. Only the participant can open the link and confirm — this
|
|
698
|
+
# endpoint just triggers the message. The provider must be enabled for the
|
|
699
|
+
# program.
|
|
700
|
+
sig do
|
|
701
|
+
params(
|
|
702
|
+
participant_id_or_email: String,
|
|
703
|
+
id: String,
|
|
704
|
+
provider:
|
|
705
|
+
GrowsurfRuby::Campaign::ParticipantRequestPayoutDestinationConfirmationParams::Provider::OrSymbol,
|
|
706
|
+
request_options: GrowsurfRuby::RequestOptions::OrHash
|
|
707
|
+
).returns(
|
|
708
|
+
GrowsurfRuby::Models::Campaign::ParticipantRequestPayoutDestinationConfirmationResponse
|
|
709
|
+
)
|
|
710
|
+
end
|
|
711
|
+
def request_payout_destination_confirmation(
|
|
712
|
+
# Path param: GrowSurf participant ID or URL-encoded participant email address.
|
|
713
|
+
participant_id_or_email,
|
|
714
|
+
# Path param: GrowSurf program ID.
|
|
715
|
+
id:,
|
|
716
|
+
# Body param: The payout provider the participant should confirm a destination for.
|
|
717
|
+
provider:,
|
|
718
|
+
request_options: {}
|
|
719
|
+
)
|
|
720
|
+
end
|
|
721
|
+
|
|
637
722
|
# @api private
|
|
638
723
|
sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
|
|
639
724
|
def self.new(client:)
|
|
@@ -23,8 +23,9 @@ module GrowsurfRuby
|
|
|
23
23
|
)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
# Approves a manually approved reward earned by a participant.
|
|
27
|
-
# `reward:write`.
|
|
26
|
+
# Approves a manually approved reward earned by a participant. This requires
|
|
27
|
+
# `reward:write`. When the request also sets `fulfill` to `true`, it additionally
|
|
28
|
+
# requires `reward:fulfill`.
|
|
28
29
|
sig do
|
|
29
30
|
params(
|
|
30
31
|
reward_id: String,
|
|
@@ -44,7 +45,7 @@ module GrowsurfRuby
|
|
|
44
45
|
)
|
|
45
46
|
end
|
|
46
47
|
|
|
47
|
-
# Marks an approved participant reward as fulfilled.
|
|
48
|
+
# Marks an approved participant reward as fulfilled.
|
|
48
49
|
sig do
|
|
49
50
|
params(
|
|
50
51
|
reward_id: String,
|
|
@@ -4,7 +4,9 @@ module GrowsurfRuby
|
|
|
4
4
|
module Resources
|
|
5
5
|
class Campaign
|
|
6
6
|
class Rewards
|
|
7
|
-
# Retrieves the
|
|
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
|
sig do
|
|
9
11
|
params(
|
|
10
12
|
id: String,
|
|
@@ -18,8 +20,11 @@ module GrowsurfRuby
|
|
|
18
20
|
)
|
|
19
21
|
end
|
|
20
22
|
|
|
21
|
-
# Creates a
|
|
22
|
-
# program type
|
|
23
|
+
# Creates a new campaign reward (`CampaignReward`) with a GrowSurf-assigned ID.
|
|
24
|
+
# The reward type must be compatible with the program type (affiliate programs
|
|
25
|
+
# support only `AFFILIATE` rewards; referral programs support all other types).
|
|
26
|
+
# Enabling an active reward of a type automatically enables that reward type on
|
|
27
|
+
# the program.
|
|
23
28
|
sig do
|
|
24
29
|
params(
|
|
25
30
|
id: String,
|
|
@@ -100,8 +105,8 @@ module GrowsurfRuby
|
|
|
100
105
|
referral_description: nil,
|
|
101
106
|
# Body param
|
|
102
107
|
referred_reward_upfront: nil,
|
|
103
|
-
# Body param: Tax
|
|
104
|
-
# reward. Defaults to
|
|
108
|
+
# Body param: Tax treatment override for the referred friend's side of a double-sided
|
|
109
|
+
# reward. Defaults to the program's confirmed default.
|
|
105
110
|
referred_value: nil,
|
|
106
111
|
# Body param
|
|
107
112
|
title: nil,
|
|
@@ -112,8 +117,11 @@ module GrowsurfRuby
|
|
|
112
117
|
)
|
|
113
118
|
end
|
|
114
119
|
|
|
115
|
-
# Updates an existing campaign reward.
|
|
116
|
-
#
|
|
120
|
+
# Updates an existing campaign reward (`CampaignReward`). The reward `type` is
|
|
121
|
+
# immutable and cannot be changed. When the update replaces `metadata`, renamed
|
|
122
|
+
# keys automatically rewrite any `{{campaignReward[…]}}` references in campaign
|
|
123
|
+
# copy; removing a key that campaign copy still references returns a `409` listing
|
|
124
|
+
# the referencing fields.
|
|
117
125
|
sig do
|
|
118
126
|
params(
|
|
119
127
|
campaign_reward_id: String,
|
|
@@ -193,8 +201,8 @@ module GrowsurfRuby
|
|
|
193
201
|
referral_description: nil,
|
|
194
202
|
# Body param
|
|
195
203
|
referred_reward_upfront: nil,
|
|
196
|
-
# Body param: Tax
|
|
197
|
-
# reward. Defaults to
|
|
204
|
+
# Body param: Tax treatment override for the referred friend's side of a double-sided
|
|
205
|
+
# reward. Defaults to the program's confirmed default.
|
|
198
206
|
referred_value: nil,
|
|
199
207
|
# Body param
|
|
200
208
|
title: nil,
|
|
@@ -205,7 +213,11 @@ module GrowsurfRuby
|
|
|
205
213
|
)
|
|
206
214
|
end
|
|
207
215
|
|
|
208
|
-
# Deletes a campaign reward.
|
|
216
|
+
# Deletes a campaign reward (`CampaignReward`). The reward is deactivated, removed
|
|
217
|
+
# from the program's reward set, and any connected upfront-discount coupons are
|
|
218
|
+
# cleaned up. If campaign copy still references any of the reward's metadata keys
|
|
219
|
+
# via `{{campaignReward[…]}}` tokens, the delete returns a `409` listing the
|
|
220
|
+
# referencing fields — update those fields first.
|
|
209
221
|
sig do
|
|
210
222
|
params(
|
|
211
223
|
campaign_reward_id: String,
|