growsurf-ruby 1.1.2 → 1.2.1

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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +14 -0
  3. data/README.md +1 -1
  4. data/lib/growsurf_ruby/client.rb +5 -5
  5. data/lib/growsurf_ruby/models/account_create_response.rb +5 -12
  6. data/lib/growsurf_ruby/models/team.rb +48 -0
  7. data/lib/growsurf_ruby/models/team_resend_owner_verification_email_response.rb +34 -0
  8. data/lib/growsurf_ruby/models/{account_rotate_api_key_response.rb → team_rotate_api_key_response.rb} +3 -3
  9. data/lib/growsurf_ruby/models/team_update_params.rb +22 -0
  10. data/lib/growsurf_ruby/models.rb +3 -3
  11. data/lib/growsurf_ruby/resources/account.rb +18 -124
  12. data/lib/growsurf_ruby/resources/campaign/commission.rb +3 -2
  13. data/lib/growsurf_ruby/resources/campaign/design.rb +7 -11
  14. data/lib/growsurf_ruby/resources/campaign/emails.rb +9 -11
  15. data/lib/growsurf_ruby/resources/campaign/installation.rb +8 -12
  16. data/lib/growsurf_ruby/resources/campaign/options.rb +11 -13
  17. data/lib/growsurf_ruby/resources/campaign/participant.rb +45 -36
  18. data/lib/growsurf_ruby/resources/campaign/reward.rb +4 -3
  19. data/lib/growsurf_ruby/resources/campaign/rewards.rb +18 -6
  20. data/lib/growsurf_ruby/resources/campaign.rb +16 -13
  21. data/lib/growsurf_ruby/resources/team.rb +118 -0
  22. data/lib/growsurf_ruby/version.rb +1 -1
  23. data/lib/growsurf_ruby.rb +5 -4
  24. data/rbi/growsurf_ruby/client.rbi +4 -1
  25. data/rbi/growsurf_ruby/models/account_create_response.rbi +0 -8
  26. data/rbi/growsurf_ruby/models/team.rbi +65 -0
  27. data/rbi/growsurf_ruby/models/{account_resend_verification_email_response.rbi → team_resend_owner_verification_email_response.rbi} +8 -18
  28. data/rbi/growsurf_ruby/models/{account_rotate_api_key_response.rbi → team_rotate_api_key_response.rbi} +3 -7
  29. data/rbi/growsurf_ruby/models/team_update_params.rbi +35 -0
  30. data/rbi/growsurf_ruby/models.rbi +3 -3
  31. data/rbi/growsurf_ruby/resources/account.rbi +13 -85
  32. data/rbi/growsurf_ruby/resources/campaign/commission.rbi +3 -2
  33. data/rbi/growsurf_ruby/resources/campaign/design.rbi +7 -5
  34. data/rbi/growsurf_ruby/resources/campaign/emails.rbi +9 -6
  35. data/rbi/growsurf_ruby/resources/campaign/installation.rbi +8 -8
  36. data/rbi/growsurf_ruby/resources/campaign/options.rbi +11 -8
  37. data/rbi/growsurf_ruby/resources/campaign/participant.rbi +45 -36
  38. data/rbi/growsurf_ruby/resources/campaign/reward.rbi +4 -3
  39. data/rbi/growsurf_ruby/resources/campaign/rewards.rbi +18 -6
  40. data/rbi/growsurf_ruby/resources/campaign.rbi +16 -11
  41. data/rbi/growsurf_ruby/resources/team.rbi +75 -0
  42. data/sig/growsurf_ruby/client.rbs +3 -1
  43. data/sig/growsurf_ruby/models/account_create_response.rbs +0 -5
  44. data/sig/growsurf_ruby/models/team.rbs +36 -0
  45. data/sig/growsurf_ruby/models/team_resend_owner_verification_email_response.rbs +31 -0
  46. data/sig/growsurf_ruby/models/{account_rotate_api_key_response.rbs → team_rotate_api_key_response.rbs} +2 -2
  47. data/sig/growsurf_ruby/models/team_update_params.rbs +23 -0
  48. data/sig/growsurf_ruby/models.rbs +3 -3
  49. data/sig/growsurf_ruby/resources/account.rbs +0 -23
  50. data/sig/growsurf_ruby/resources/team.rbs +28 -0
  51. metadata +17 -14
  52. data/lib/growsurf_ruby/models/account.rb +0 -90
  53. data/lib/growsurf_ruby/models/account_resend_verification_email_response.rb +0 -33
  54. data/lib/growsurf_ruby/models/account_update_params.rb +0 -35
  55. data/rbi/growsurf_ruby/models/account.rbi +0 -125
  56. data/rbi/growsurf_ruby/models/account_update_params.rbi +0 -65
  57. data/sig/growsurf_ruby/models/account.rbs +0 -67
  58. data/sig/growsurf_ruby/models/account_resend_verification_email_response.rbs +0 -35
  59. data/sig/growsurf_ruby/models/account_update_params.rbs +0 -42
@@ -2,24 +2,20 @@
2
2
 
3
3
  module GrowsurfRuby
4
4
  module Models
5
- class AccountRotateAPIKeyResponse < GrowsurfRuby::Internal::Type::BaseModel
5
+ class TeamRotateAPIKeyResponse < GrowsurfRuby::Internal::Type::BaseModel
6
6
  OrHash =
7
7
  T.type_alias do
8
8
  T.any(
9
- GrowsurfRuby::Models::AccountRotateAPIKeyResponse,
9
+ GrowsurfRuby::Models::TeamRotateAPIKeyResponse,
10
10
  GrowsurfRuby::Internal::AnyHash
11
11
  )
12
12
  end
13
13
 
14
- # The new API key. Store it now; the key used for rotation stops working immediately.
15
14
  sig { returns(String) }
16
15
  attr_accessor :api_key
17
16
 
18
17
  sig { params(api_key: String).returns(T.attached_class) }
19
- def self.new(
20
- # The new API key. Store it now; the key used for rotation stops working immediately.
21
- api_key:
22
- )
18
+ def self.new(api_key:)
23
19
  end
24
20
 
25
21
  sig { override.returns({ api_key: String }) }
@@ -0,0 +1,35 @@
1
+ # typed: strong
2
+
3
+ module GrowsurfRuby
4
+ module Models
5
+ class TeamUpdateParams < GrowsurfRuby::Internal::Type::BaseModel
6
+ extend GrowsurfRuby::Internal::Type::RequestParameters::Converter
7
+ include GrowsurfRuby::Internal::Type::RequestParameters
8
+
9
+ OrHash =
10
+ T.type_alias do
11
+ T.any(GrowsurfRuby::TeamUpdateParams, GrowsurfRuby::Internal::AnyHash)
12
+ end
13
+
14
+ sig { returns(String) }
15
+ attr_accessor :name
16
+
17
+ sig do
18
+ params(
19
+ name: String,
20
+ request_options: GrowsurfRuby::RequestOptions::OrHash
21
+ ).returns(T.attached_class)
22
+ end
23
+ def self.new(name:, request_options: {})
24
+ end
25
+
26
+ sig do
27
+ override.returns(
28
+ { name: String, request_options: GrowsurfRuby::RequestOptions }
29
+ )
30
+ end
31
+ def to_hash
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,11 +1,11 @@
1
1
  # typed: strong
2
2
 
3
3
  module GrowsurfRuby
4
- Account = GrowsurfRuby::Models::Account
5
-
6
4
  AccountCreateParams = GrowsurfRuby::Models::AccountCreateParams
7
5
 
8
- AccountUpdateParams = GrowsurfRuby::Models::AccountUpdateParams
6
+ Team = GrowsurfRuby::Models::Team
7
+
8
+ TeamUpdateParams = GrowsurfRuby::Models::TeamUpdateParams
9
9
 
10
10
  Campaign = GrowsurfRuby::Models::Campaign
11
11
 
@@ -4,20 +4,19 @@ module GrowsurfRuby
4
4
  module Resources
5
5
  class Account
6
6
  # Creates a new GrowSurf account. This is the only endpoint that does not require
7
- # an API key. The response includes an API key for the new account, shown once
8
- # in the response. The key is locked until the account's email address is
9
- # verified: authenticated endpoints outside the `Accounts` group return a `403`
10
- # with error code
11
- # `EMAIL_NOT_VERIFIED_ERROR` until then (resend the email via `POST
12
- # /account/verification-email`, then retry). A welcome email is sent to the
13
- # address with the verification link and a set-password link for dashboard
14
- # access. Accounts whose email is never verified are deleted automatically after
15
- # 7 days. For security, the API key is rotated the first time the account owner
16
- # signs in to the GrowSurf dashboard. Some actions (such as emailing
17
- # participants) additionally require the GrowSurf team to verify the account
18
- # first. By creating an account you agree, on behalf of the account holder, to
19
- # GrowSurf's [Terms of Service](https://growsurf.com/terms) and
20
- # [Privacy Policy](https://growsurf.com/privacy).
7
+ # an API key. The response includes an API key for the new account, shown once in
8
+ # the response. The key is locked until the team owner's email address is
9
+ # verified: authenticated program and resource endpoints return a `403` with error
10
+ # code `EMAIL_NOT_VERIFIED_ERROR` until then (resend the email via `POST
11
+ # /team/owner/verification-email`, then retry). A welcome email is sent to the
12
+ # address with the verification link and a set-password link for dashboard access.
13
+ # Accounts whose email is never verified are deleted automatically after 7 days.
14
+ # For security, the API key is rotated the first time the account owner signs in
15
+ # to the GrowSurf dashboard. Some actions (such as emailing participants)
16
+ # additionally require GrowSurf to verify the team first. By creating an account
17
+ # you agree, on behalf of the account holder, to GrowSurf's [Terms of
18
+ # Service](https://growsurf.com/terms) and [Privacy
19
+ # Policy](https://growsurf.com/privacy).
21
20
  sig do
22
21
  params(
23
22
  email: String,
@@ -28,7 +27,6 @@ module GrowsurfRuby
28
27
  ).returns(GrowsurfRuby::Models::AccountCreateResponse)
29
28
  end
30
29
  def create(
31
- # The email address for the new account. Personal emails and disposable email addresses are not accepted.
32
30
  email:,
33
31
  company: nil,
34
32
  first_name: nil,
@@ -37,76 +35,6 @@ module GrowsurfRuby
37
35
  )
38
36
  end
39
37
 
40
- # Retrieves the account that owns the API key: profile and GrowSurf-team
41
- # verification state.
42
- # `verificationStatus` is `VERIFIED` once the GrowSurf team has verified the account
43
- # — this is required before you can send participant emails from a program.
44
- sig do
45
- params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
46
- GrowsurfRuby::Account
47
- )
48
- end
49
- def retrieve(request_options: {})
50
- end
51
-
52
- # Updates your own account profile (`firstName`, `lastName`, `company`). Any other
53
- # property is rejected with a `400` — in particular, the account `email` cannot be
54
- # changed via the API, and billing/subscription is not editable here.
55
- sig do
56
- params(
57
- company: String,
58
- first_name: String,
59
- last_name: String,
60
- request_options: GrowsurfRuby::RequestOptions::OrHash
61
- ).returns(GrowsurfRuby::Account)
62
- end
63
- def update(
64
- company: nil,
65
- first_name: nil,
66
- last_name: nil,
67
- request_options: {}
68
- )
69
- end
70
-
71
- # Generates a new API key and invalidates the key used for the request. The SDK
72
- # sends a retry-safe `Idempotency-Key`, so automatic retries return the same
73
- # replacement. Store the returned key, then update every integration that used
74
- # the old key. The account owner is notified by email whenever the key is rotated.
75
- # Requires an API key with `api_key:rotate`. This operation is available only through
76
- # the REST API or a GrowSurf API SDK, not through MCP.
77
- sig do
78
- params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
79
- GrowsurfRuby::Models::AccountRotateAPIKeyResponse
80
- )
81
- end
82
- def rotate_api_key(request_options: {})
83
- end
84
-
85
- # Requests GrowSurf-team verification of your account (required before a program can
86
- # email its participants). Idempotent — calling it again while a request is pending
87
- # does not create a duplicate. Returns the account with its updated
88
- # `verificationStatus`.
89
- sig do
90
- params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
91
- GrowsurfRuby::Account
92
- )
93
- end
94
- def request_verification(request_options: {})
95
- end
96
-
97
- # Resends the email-verification email to the account's email address. A `200`
98
- # with `status: SENT` is only returned when an email was actually dispatched.
99
- # Returns a `400` if the email is already verified, or a `429` if a verification
100
- # email was sent too recently — wait a moment, then retry.
101
- sig do
102
- params(request_options: GrowsurfRuby::RequestOptions::OrHash).returns(
103
- GrowsurfRuby::Models::AccountResendVerificationEmailResponse
104
- )
105
- end
106
- def resend_verification_email(request_options: {})
107
- end
108
-
109
- # @api private
110
38
  sig { params(client: GrowsurfRuby::Client).returns(T.attached_class) }
111
39
  def self.new(client:)
112
40
  end
@@ -5,7 +5,7 @@ module GrowsurfRuby
5
5
  class Campaign
6
6
  # Affiliate transaction, commission, and payout operations.
7
7
  class Commission
8
- # Removes a pending participant commission.
8
+ # **Affiliate programs only.** Removes a pending participant commission.
9
9
  sig do
10
10
  params(
11
11
  commission_id: String,
@@ -22,7 +22,8 @@ module GrowsurfRuby
22
22
  )
23
23
  end
24
24
 
25
- # Approves a pending participant commission so it can become eligible for payout.
25
+ # **Affiliate programs only.** Approves a pending participant commission so it can
26
+ # become eligible for payout.
26
27
  sig do
27
28
  params(
28
29
  commission_id: String,
@@ -5,9 +5,11 @@ module GrowsurfRuby
5
5
  class Campaign
6
6
  class Design
7
7
  # Retrieves a program's design configuration — the same surface as the dashboard
8
- # Program Editor's **Design** tab. This is a large, deeply nested object whose
8
+ # Program Editor's **Design** tab: the GrowSurf window layout, header, share
9
+ # channels + invite, signup form, portal/landing pages, theme styling, and the
10
+ # referral/affiliate summary + status sections. This is a large object whose
9
11
  # available fields depend on the program type; the response includes every field
10
- # and its current value, which is the same shape you send back on update.
12
+ # and its current value, which is the same shape you send back on `PATCH`.
11
13
  sig do
12
14
  params(
13
15
  id: String,
@@ -23,9 +25,9 @@ module GrowsurfRuby
23
25
 
24
26
  # Updates a program's design configuration. Only the fields you send are changed;
25
27
  # anything you leave out is untouched (arrays such as `signup.fields` replace
26
- # wholesale). The request body is a partial design object. To see the full object
27
- # with every field and its current value, `GET` this resource, then `PATCH` back
28
- # only the fields you want to change.
28
+ # wholesale). Unknown fields, fields not available for the program type, and
29
+ # invalid values return a `400`. Landing-page custom code and JavaScript are not
30
+ # editable via the API.
29
31
  sig do
30
32
  params(
31
33
  id: String,
@@ -5,9 +5,10 @@ module GrowsurfRuby
5
5
  class Campaign
6
6
  class Emails
7
7
  # Retrieves a program's email configuration — the same surface as the dashboard
8
- # Program Editor's **Emails** tab. To see the full object with every field and its
9
- # current value, `GET` this resource, then `PATCH` back only the fields you want to
10
- # change.
8
+ # Program Editor's **Emails** tab. Returns each editable email template
9
+ # (`subject`, `preheader`, `body`, `isEnabled`) plus the `settings` block (sender,
10
+ # contact, and design). The set of email templates returned depends on the program
11
+ # type (referral vs affiliate).
11
12
  sig do
12
13
  params(
13
14
  id: String,
@@ -22,9 +23,11 @@ module GrowsurfRuby
22
23
  end
23
24
 
24
25
  # Updates a program's email configuration. Only the fields you send are changed;
25
- # anything you leave out is untouched. The request body is a partial email
26
- # configuration object. To see the full object with every field and its current
27
- # value, `GET` this resource, then `PATCH` back only the fields you want to change.
26
+ # omitted fields are left untouched. You may only write the email templates the
27
+ # dashboard exposes for the program type writing a template that is not
28
+ # available for the program type returns a `400`. Some fields are read-only
29
+ # (`settings.sender.fromEmail`, whose custom value requires dashboard domain
30
+ # verification).
28
31
  sig do
29
32
  params(
30
33
  id: String,
@@ -5,10 +5,9 @@ module GrowsurfRuby
5
5
  class Campaign
6
6
  class Installation
7
7
  # Retrieves a program's installation configuration — the same surface as the
8
- # dashboard Program Editor's **Installation** tab. This is a nested object whose
9
- # available fields depend on the program type. To see the full object with every
10
- # field and its current value, `GET` this resource, then `PATCH` back only the
11
- # fields you want to change.
8
+ # dashboard Program Editor's **Installation** tab (plus the Mobile SDK settings).
9
+ # Includes the referral trigger (referral programs only), signup tracking method,
10
+ # share URL and whitelist, custom-form signup settings, and mobile SDK settings.
12
11
  sig do
13
12
  params(
14
13
  id: String,
@@ -23,10 +22,11 @@ module GrowsurfRuby
23
22
  end
24
23
 
25
24
  # Updates a program's installation configuration. Only the fields you send are
26
- # changed; anything you leave out is untouched. The request body is a partial
27
- # installation configuration object. To see the full object with every field and
28
- # its current value, `GET` this resource, then `PATCH` back only the fields you
29
- # want to change.
25
+ # changed; omitted fields are left untouched. `referralTrigger` is only available
26
+ # for referral programs. `mobile.publicKey` is read-only; if no key exists yet,
27
+ # enabling `mobile.isEnabled` creates one. Changing `shareUrl` re-resolves its
28
+ # redirect destinations, which may take a moment to complete. URLs must include an
29
+ # explicit `http://` or `https://` scheme.
30
30
  sig do
31
31
  params(
32
32
  id: String,
@@ -4,10 +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. To see the full object with every field and its
9
- # current value, `GET` this resource, then `PATCH` back only the fields you want to
10
- # 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, payout threshold + tax
10
+ # settings (affiliate only), and notification-email settings.
11
+ # `fraud.recaptcha.secretKey` is never returned.
11
12
  sig do
12
13
  params(
13
14
  id: String,
@@ -21,10 +22,12 @@ module GrowsurfRuby
21
22
  )
22
23
  end
23
24
 
24
- # Updates a program's options configuration. Only the fields you send are changed;
25
- # anything you leave out is untouched. The request body is a partial options
26
- # configuration object. To see the full object with every field and its current
27
- # value, `GET` this resource, then `PATCH` back only the fields you want to change.
25
+ # Updates a program's options. Only the fields you send are changed. Some fields
26
+ # are program-type specific (`requireManualRewardApproval`/`autoFulfillRewards`
27
+ # are referral-only; `payoutThreshold`/`taxDocumentation` are affiliate-only, and
28
+ # affiliate programs require `requireParticipantAuth: true`).
29
+ # `fraud.recaptcha.secretKey` is write-only. `referralCreditWindowDays: null`
30
+ # means "never expires".
28
31
  sig do
29
32
  params(
30
33
  id: String,
@@ -88,12 +88,12 @@ module GrowsurfRuby
88
88
  end
89
89
 
90
90
  # 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
- # are allowed). Up to `200` entries per request — chunk larger lists across
93
- # multiple calls. The response reports a per-row `status` for every submitted
94
- # entry, so a `200` can include rows that were `NOT_FOUND` or failed. Deletion
95
- # is permanent and removes the participants' referrals, rewards, commissions,
96
- # and payout records.
91
+ # `participants` is a GrowSurf participant ID or an email address (mixed lists are
92
+ # allowed). Up to `200` entries per request — chunk larger lists across multiple
93
+ # calls. The response reports a per-row `status` for every submitted entry, so a
94
+ # `200` can include rows that were `NOT_FOUND` or failed. Deletion is permanent
95
+ # and removes the participants' referrals, rewards, commissions, and payout
96
+ # records.
97
97
  sig do
98
98
  params(
99
99
  id: String,
@@ -156,7 +156,8 @@ module GrowsurfRuby
156
156
  )
157
157
  end
158
158
 
159
- # Retrieves a paged list of commissions earned by a participant.
159
+ # **Affiliate programs only.** Retrieves a paged list of commissions earned by a
160
+ # participant.
160
161
  sig do
161
162
  params(
162
163
  participant_id_or_email: String,
@@ -183,7 +184,8 @@ module GrowsurfRuby
183
184
  )
184
185
  end
185
186
 
186
- # Retrieves a paged list of payouts that belong to a participant.
187
+ # **Affiliate programs only.** Retrieves a paged list of payouts that belong to a
188
+ # participant.
187
189
  sig do
188
190
  params(
189
191
  participant_id_or_email: String,
@@ -280,15 +282,12 @@ module GrowsurfRuby
280
282
  )
281
283
  end
282
284
 
283
- # Records a sale made by a referred customer and generates affiliate commissions
284
- # for their referrer when applicable.
285
- #
286
- # At least one transaction identifier is required: one of +external_id+,
287
- # +transaction_id+, +order_id+, +payment_id+, +invoice_id+, +payment_intent_id+,
288
- # or +charge_id+. +customer_id+ and +subscription_id+ do not count, since they
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.
285
+ # **Affiliate programs only.** Records a sale made by a referred customer and
286
+ # generates affiliate commissions for their referrer when applicable. Requires at
287
+ # least one transaction identifier (externalId, transactionId, orderId, paymentId,
288
+ # invoiceId, paymentIntentId, or chargeId) so repeated requests can be
289
+ # de-duplicated without one, a resent sale would create a second commission.
290
+ # Reuse the same identifier(s) when refunding.
292
291
  sig do
293
292
  params(
294
293
  participant_id_or_email: String,
@@ -376,9 +375,12 @@ module GrowsurfRuby
376
375
  )
377
376
  end
378
377
 
379
- # Records an amendment (refund, partial refund, refund cancellation, or
380
- # chargeback) against a previously recorded transaction and reverses or adjusts
381
- # the referrer's commission.
378
+ # **Affiliate programs only.** Records an amendment (refund, partial refund,
379
+ # refund cancellation, or chargeback) against a previously recorded transaction
380
+ # and reverses or adjusts the referrer's commission. The inverse of Record
381
+ # Affiliate Transaction. Identify the original transaction with the same
382
+ # identifier(s) you sent when recording it. Commissions already paid out to the
383
+ # affiliate are not clawed back; the amendment is recorded for tax reporting only.
382
384
  sig do
383
385
  params(
384
386
  participant_id_or_email: String,
@@ -444,7 +446,7 @@ module GrowsurfRuby
444
446
  end
445
447
 
446
448
  # 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
449
+ # Sending invites via the API requires a **verified custom email domain** on the
448
450
  # program; the request fails until one is verified.
449
451
  sig do
450
452
  params(
@@ -474,7 +476,10 @@ module GrowsurfRuby
474
476
  end
475
477
 
476
478
  # Triggers referral credit for an existing referred participant by GrowSurf
477
- # participant ID or email address.
479
+ # participant ID or email address. Optionally pass `delayInDays` to hold the
480
+ # credit for a number of days before it is awarded (for example, to cover your own
481
+ # refund window). A delayed trigger can be cancelled before it is awarded with the
482
+ # Cancel delayed referral trigger request (DELETE on this same path).
478
483
  sig do
479
484
  params(
480
485
  participant_id_or_email: String,
@@ -500,8 +505,11 @@ module GrowsurfRuby
500
505
  )
501
506
  end
502
507
 
503
- # Cancels a pending delayed referral trigger for an existing referred participant
504
- # by GrowSurf participant ID or email address.
508
+ # Cancels a pending delayed referral trigger for a participant (the companion to a
509
+ # delayed Trigger referral request). Use this to undo a scheduled referral credit
510
+ # before it is awarded, for example when a refund occurs inside your refund
511
+ # window. If the participant has no pending delayed trigger, `success` is returned
512
+ # as `false`.
505
513
  sig do
506
514
  params(
507
515
  participant_id_or_email: String,
@@ -520,15 +528,14 @@ module GrowsurfRuby
520
528
  )
521
529
  end
522
530
 
523
- # Sends an email to a participant. Provide EITHER `email_type` to trigger one of the
524
- # program's configured email templates, OR `subject` + `body` for a free-form email.
525
- # Free-form emails are sent with the same compliance handling (company name,
526
- # postal address, and an unsubscribe link are added automatically, and unsubscribed
527
- # participants are suppressed). Sending requires the account to be verified by the
528
- # GrowSurf team. Requires a verified custom email domain on the program (set up
529
- # in Campaign Editor > 3. Emails > Email Settings). Returns `400` until one is
530
- # verified.
531
- # The email is accepted for delivery.
531
+ # Sends an email to a participant. Provide EITHER `emailType` to trigger one of
532
+ # the program's configured email templates, OR `subject` + `body` for a free-form
533
+ # email. Free-form emails are sent with the same compliance handling (company
534
+ # name, postal address, and an unsubscribe link are added automatically, and
535
+ # unsubscribed participants are suppressed). Sending requires the team to be
536
+ # verified by GrowSurf. Requires a **verified custom email domain** on the program
537
+ # (which can be completed in *Campaign Editor > 3. Emails > Email Settings*).
538
+ # Returns `400` until one is verified. The email is accepted for delivery.
532
539
  sig do
533
540
  params(
534
541
  participant_id_or_email: String,
@@ -569,7 +576,8 @@ module GrowsurfRuby
569
576
  )
570
577
  end
571
578
 
572
- # Returns a participant's activity logs, most recent first (offset/limit paginated).
579
+ # Returns a participant's activity logs, most recent first (offset/limit
580
+ # paginated).
573
581
  sig do
574
582
  params(
575
583
  participant_id_or_email: String,
@@ -595,8 +603,9 @@ module GrowsurfRuby
595
603
  end
596
604
 
597
605
  # Retrieves analytics for a single participant — all-time engagement counters,
598
- # leaderboard ranks, and per-channel share counts (plus affiliate money metrics for
599
- # affiliate programs). Useful for segmenting and re-engaging participants.
606
+ # leaderboard ranks, and per-channel share counts (plus affiliate money metrics
607
+ # for affiliate programs). Useful for segmenting and re-engaging participants.
608
+ # Pass `include=series` to also get this participant's own activity over time.
600
609
  sig do
601
610
  params(
602
611
  participant_id_or_email: String,
@@ -23,8 +23,9 @@ module GrowsurfRuby
23
23
  )
24
24
  end
25
25
 
26
- # Approves a manually approved reward earned by a participant. Requires
27
- # `reward:write`. Passing `fulfill: true` also requires `reward:fulfill`.
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. Requires `reward:fulfill`.
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 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
  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 reward for a program. The reward `type` must be compatible with the
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,
@@ -112,8 +117,11 @@ module GrowsurfRuby
112
117
  )
113
118
  end
114
119
 
115
- # Updates an existing campaign reward. Only the fields you send are changed; `type`
116
- # is immutable and must not be supplied.
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,
@@ -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,
@@ -61,9 +61,8 @@ module GrowsurfRuby
61
61
  def list(request_options: {})
62
62
  end
63
63
 
64
- # Creates a program. Only `type` is required; everything else is server-defaulted.
65
- # Editor-tab configuration (design, emails, options, installation) is not accepted
66
- # here — configure it via the config sub-resources after the program is created.
64
+ # Creates a new program, plus any optional program rewards. The new program is
65
+ # created in `DRAFT` status and owned by the API key's bound team.
67
66
  sig do
68
67
  params(
69
68
  type: GrowsurfRuby::CampaignCreateParams::Type::OrSymbol,
@@ -91,10 +90,11 @@ module GrowsurfRuby
91
90
  )
92
91
  end
93
92
 
94
- # Updates a program's identity and lifecycle. Only the fields you send are changed.
95
- # `type`, `urlId`, and `currencyISO` are immutable. Editor-tab configuration (design, emails,
96
- # options, installation) is edited via the dedicated config sub-resources, not
97
- # here.
93
+ # Updates a program's identity and lifecycle. Only the fields you send are
94
+ # changed. `type`, `urlId`, and `currencyISO` are immutable. Editor-tab
95
+ # configuration (design, emails, options, installation) is edited via the
96
+ # dedicated config sub-resources, not here. The program cannot be deleted via this
97
+ # endpoint.
98
98
  sig do
99
99
  params(
100
100
  id: String,
@@ -121,7 +121,8 @@ module GrowsurfRuby
121
121
  )
122
122
  end
123
123
 
124
- # Clones an existing program, returning the newly created program.
124
+ # Clones an existing program into a new `DRAFT` program. Integrations and
125
+ # credentials are not copied; active rewards are cloned.
125
126
  sig do
126
127
  params(
127
128
  id: String,
@@ -178,7 +179,8 @@ module GrowsurfRuby
178
179
  )
179
180
  end
180
181
 
181
- # Retrieves a paged list of all participant commissions in an affiliate program.
182
+ # **Affiliate programs only.** Retrieves a paged list of all participant
183
+ # commissions in an affiliate program.
182
184
  sig do
183
185
  params(
184
186
  id: String,
@@ -248,7 +250,8 @@ module GrowsurfRuby
248
250
  )
249
251
  end
250
252
 
251
- # Retrieves a paged list of all participant payouts in an affiliate program.
253
+ # **Affiliate programs only.** Retrieves a paged list of all participant payouts
254
+ # in an affiliate program.
252
255
  sig do
253
256
  params(
254
257
  id: String,
@@ -312,7 +315,9 @@ module GrowsurfRuby
312
315
  )
313
316
  end
314
317
 
315
- # Retrieves analytics for a program.
318
+ # Retrieves analytics for a program. Pass `interval` to also get a time-series
319
+ # (`series`) alongside the totals, and `include` to add previous-period totals,
320
+ # status breakdowns, or derived rates — useful for detecting trends over time.
316
321
  sig do
317
322
  params(
318
323
  id: String,