Skip to content

Commit 021294e

Browse files
feat(api): api update
1 parent 1153749 commit 021294e

11 files changed

Lines changed: 148 additions & 23 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 191
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-97e920db587b07c064bef1bf31de5e110a3750ddfddc8fca26642e79e6b827f8.yml
3-
openapi_spec_hash: 97ca16cc55271602443a4329d1e02895
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-e3735d7700813328ddb9c3da0127c03351e1e2102d6197b3a22f7a0627209488.yml
3+
openapi_spec_hash: 6bd34ccbef8a342ba0f04737113b3529
44
config_hash: 1a836d20bb988f001cc66d1526f71306

src/whop_sdk/resources/companies.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,11 @@ def update(
163163
self,
164164
id: str,
165165
*,
166+
affiliate_application_required: Optional[bool] | Omit = omit,
167+
affiliate_instructions: Optional[str] | Omit = omit,
166168
banner_image: Optional[company_update_params.BannerImage] | Omit = omit,
167169
description: Optional[str] | Omit = omit,
170+
featured_affiliate_product_id: Optional[str] | Omit = omit,
168171
logo: Optional[company_update_params.Logo] | Omit = omit,
169172
route: Optional[str] | Omit = omit,
170173
send_customer_emails: Optional[bool] | Omit = omit,
@@ -186,11 +189,20 @@ def update(
186189
- `company:basic:read`
187190
188191
Args:
192+
affiliate_application_required: Whether prospective affiliates must submit an application before they can
193+
promote this company.
194+
195+
affiliate_instructions: Guidelines and instructions shown to affiliates explaining how to promote this
196+
company's products.
197+
189198
banner_image: The company's banner image. Accepts PNG or JPEG format.
190199
191200
description: A promotional pitch displayed to potential customers on the company's store
192201
page.
193202
203+
featured_affiliate_product_id: The ID of the product to feature on this company's affiliate page. Pass null to
204+
clear.
205+
194206
logo: The company's logo image. Accepts PNG, JPEG, or GIF format.
195207
196208
route: The unique URL slug for the company's store page. Must be lowercase and can
@@ -219,8 +231,11 @@ def update(
219231
f"/companies/{id}",
220232
body=maybe_transform(
221233
{
234+
"affiliate_application_required": affiliate_application_required,
235+
"affiliate_instructions": affiliate_instructions,
222236
"banner_image": banner_image,
223237
"description": description,
238+
"featured_affiliate_product_id": featured_affiliate_product_id,
224239
"logo": logo,
225240
"route": route,
226241
"send_customer_emails": send_customer_emails,
@@ -452,8 +467,11 @@ async def update(
452467
self,
453468
id: str,
454469
*,
470+
affiliate_application_required: Optional[bool] | Omit = omit,
471+
affiliate_instructions: Optional[str] | Omit = omit,
455472
banner_image: Optional[company_update_params.BannerImage] | Omit = omit,
456473
description: Optional[str] | Omit = omit,
474+
featured_affiliate_product_id: Optional[str] | Omit = omit,
457475
logo: Optional[company_update_params.Logo] | Omit = omit,
458476
route: Optional[str] | Omit = omit,
459477
send_customer_emails: Optional[bool] | Omit = omit,
@@ -475,11 +493,20 @@ async def update(
475493
- `company:basic:read`
476494
477495
Args:
496+
affiliate_application_required: Whether prospective affiliates must submit an application before they can
497+
promote this company.
498+
499+
affiliate_instructions: Guidelines and instructions shown to affiliates explaining how to promote this
500+
company's products.
501+
478502
banner_image: The company's banner image. Accepts PNG or JPEG format.
479503
480504
description: A promotional pitch displayed to potential customers on the company's store
481505
page.
482506
507+
featured_affiliate_product_id: The ID of the product to feature on this company's affiliate page. Pass null to
508+
clear.
509+
483510
logo: The company's logo image. Accepts PNG, JPEG, or GIF format.
484511
485512
route: The unique URL slug for the company's store page. Must be lowercase and can
@@ -508,8 +535,11 @@ async def update(
508535
f"/companies/{id}",
509536
body=await async_maybe_transform(
510537
{
538+
"affiliate_application_required": affiliate_application_required,
539+
"affiliate_instructions": affiliate_instructions,
511540
"banner_image": banner_image,
512541
"description": description,
542+
"featured_affiliate_product_id": featured_affiliate_product_id,
513543
"logo": logo,
514544
"route": route,
515545
"send_customer_emails": send_customer_emails,

src/whop_sdk/types/affiliate.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ class User(BaseModel):
3939

4040

4141
class Affiliate(BaseModel):
42-
"""An affiliate of a company or a global affiliate"""
42+
"""
43+
An affiliate tracks a user's referral performance and commission earnings for a company, including retention rates, revenue metrics, and payout configurations.
44+
"""
4345

4446
id: str
4547
"""The unique identifier for the affiliate."""
@@ -54,13 +56,16 @@ class Affiliate(BaseModel):
5456
"""The datetime the affiliate was created."""
5557

5658
customer_retention_rate: str
57-
"""How many referrals have remained since they joined as members"""
59+
"""The percentage of referred customers who are still active members"""
5860

5961
customer_retention_rate_ninety_days: str
60-
"""A rolling 90-day retention rate for this affiliate"""
62+
"""The percentage of referred customers who remained active over the last 90 days"""
6163

6264
monthly_recurring_revenue_usd: str
63-
"""The total MRR of the affiliate"""
65+
"""
66+
The monthly recurring revenue generated by this affiliate's referrals, formatted
67+
as a USD currency string
68+
"""
6469

6570
status: Optional[Status] = None
6671
"""Statuses for resources"""
@@ -69,13 +74,19 @@ class Affiliate(BaseModel):
6974
"""The total count of all overrides for this affiliate"""
7075

7176
total_referral_earnings_usd: str
72-
"""The total earnings of the affiliate from the users they referred"""
77+
"""
78+
The total commission earnings paid to this affiliate, formatted as a USD
79+
currency string
80+
"""
7381

7482
total_referrals_count: int
7583
"""The total referrals of the affiliate"""
7684

7785
total_revenue_usd: str
78-
"""The total revenue of the affiliate from their referrals"""
86+
"""
87+
The total revenue generated from this affiliate's referrals, formatted as a USD
88+
currency string
89+
"""
7990

8091
updated_at: datetime
8192
"""The datetime the affiliate was last updated."""

src/whop_sdk/types/affiliate_list_response.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ class User(BaseModel):
3939

4040

4141
class AffiliateListResponse(BaseModel):
42-
"""An affiliate of a company or a global affiliate"""
42+
"""
43+
An affiliate tracks a user's referral performance and commission earnings for a company, including retention rates, revenue metrics, and payout configurations.
44+
"""
4345

4446
id: str
4547
"""The unique identifier for the affiliate."""
@@ -54,13 +56,16 @@ class AffiliateListResponse(BaseModel):
5456
"""The datetime the affiliate was created."""
5557

5658
customer_retention_rate: str
57-
"""How many referrals have remained since they joined as members"""
59+
"""The percentage of referred customers who are still active members"""
5860

5961
customer_retention_rate_ninety_days: str
60-
"""A rolling 90-day retention rate for this affiliate"""
62+
"""The percentage of referred customers who remained active over the last 90 days"""
6163

6264
monthly_recurring_revenue_usd: str
63-
"""The total MRR of the affiliate"""
65+
"""
66+
The monthly recurring revenue generated by this affiliate's referrals, formatted
67+
as a USD currency string
68+
"""
6469

6570
status: Optional[Status] = None
6671
"""Statuses for resources"""
@@ -69,13 +74,19 @@ class AffiliateListResponse(BaseModel):
6974
"""The total count of all overrides for this affiliate"""
7075

7176
total_referral_earnings_usd: str
72-
"""The total earnings of the affiliate from the users they referred"""
77+
"""
78+
The total commission earnings paid to this affiliate, formatted as a USD
79+
currency string
80+
"""
7381

7482
total_referrals_count: int
7583
"""The total referrals of the affiliate"""
7684

7785
total_revenue_usd: str
78-
"""The total revenue of the affiliate from their referrals"""
86+
"""
87+
The total revenue generated from this affiliate's referrals, formatted as a USD
88+
currency string
89+
"""
7990

8091
updated_at: datetime
8192
"""The datetime the affiliate was last updated."""

src/whop_sdk/types/affiliates/override_create_response.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414

1515
class OverrideCreateResponse(BaseModel):
16-
"""An object storing information about the affiliate"""
16+
"""
17+
A commission configuration for an affiliate, defining payout terms for a specific plan or revenue share
18+
"""
1719

1820
id: str
1921
"""The unique identifier for the affiliate override."""
@@ -31,7 +33,11 @@ class OverrideCreateResponse(BaseModel):
3133
"""The type of commission (percentage or flat_fee)."""
3234

3335
commission_value: float
34-
"""The commission value (percentage 1-100 or flat fee in dollars)."""
36+
"""The commission amount.
37+
38+
A percentage (1-100) when commission_type is percentage, or a dollar amount when
39+
flat_fee.
40+
"""
3541

3642
override_type: AffiliateOverrideRoles
3743
"""The type of override (standard or rev_share)."""

src/whop_sdk/types/affiliates/override_list_response.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414

1515
class OverrideListResponse(BaseModel):
16-
"""An object storing information about the affiliate"""
16+
"""
17+
A commission configuration for an affiliate, defining payout terms for a specific plan or revenue share
18+
"""
1719

1820
id: str
1921
"""The unique identifier for the affiliate override."""
@@ -31,7 +33,11 @@ class OverrideListResponse(BaseModel):
3133
"""The type of commission (percentage or flat_fee)."""
3234

3335
commission_value: float
34-
"""The commission value (percentage 1-100 or flat fee in dollars)."""
36+
"""The commission amount.
37+
38+
A percentage (1-100) when commission_type is percentage, or a dollar amount when
39+
flat_fee.
40+
"""
3541

3642
override_type: AffiliateOverrideRoles
3743
"""The type of override (standard or rev_share)."""

src/whop_sdk/types/affiliates/override_retrieve_response.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414

1515
class OverrideRetrieveResponse(BaseModel):
16-
"""An object storing information about the affiliate"""
16+
"""
17+
A commission configuration for an affiliate, defining payout terms for a specific plan or revenue share
18+
"""
1719

1820
id: str
1921
"""The unique identifier for the affiliate override."""
@@ -31,7 +33,11 @@ class OverrideRetrieveResponse(BaseModel):
3133
"""The type of commission (percentage or flat_fee)."""
3234

3335
commission_value: float
34-
"""The commission value (percentage 1-100 or flat fee in dollars)."""
36+
"""The commission amount.
37+
38+
A percentage (1-100) when commission_type is percentage, or a dollar amount when
39+
flat_fee.
40+
"""
3541

3642
override_type: AffiliateOverrideRoles
3743
"""The type of override (standard or rev_share)."""

src/whop_sdk/types/affiliates/override_update_response.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313

1414

1515
class OverrideUpdateResponse(BaseModel):
16-
"""An object storing information about the affiliate"""
16+
"""
17+
A commission configuration for an affiliate, defining payout terms for a specific plan or revenue share
18+
"""
1719

1820
id: str
1921
"""The unique identifier for the affiliate override."""
@@ -31,7 +33,11 @@ class OverrideUpdateResponse(BaseModel):
3133
"""The type of commission (percentage or flat_fee)."""
3234

3335
commission_value: float
34-
"""The commission value (percentage 1-100 or flat fee in dollars)."""
36+
"""The commission amount.
37+
38+
A percentage (1-100) when commission_type is percentage, or a dollar amount when
39+
flat_fee.
40+
"""
3541

3642
override_type: AffiliateOverrideRoles
3743
"""The type of override (standard or rev_share)."""

src/whop_sdk/types/company_update_params.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@
99

1010

1111
class CompanyUpdateParams(TypedDict, total=False):
12+
affiliate_application_required: Optional[bool]
13+
"""
14+
Whether prospective affiliates must submit an application before they can
15+
promote this company.
16+
"""
17+
18+
affiliate_instructions: Optional[str]
19+
"""
20+
Guidelines and instructions shown to affiliates explaining how to promote this
21+
company's products.
22+
"""
23+
1224
banner_image: Optional[BannerImage]
1325
"""The company's banner image. Accepts PNG or JPEG format."""
1426

@@ -18,6 +30,12 @@ class CompanyUpdateParams(TypedDict, total=False):
1830
page.
1931
"""
2032

33+
featured_affiliate_product_id: Optional[str]
34+
"""The ID of the product to feature on this company's affiliate page.
35+
36+
Pass null to clear.
37+
"""
38+
2139
logo: Optional[Logo]
2240
"""The company's logo image. Accepts PNG, JPEG, or GIF format."""
2341

src/whop_sdk/types/shared/company.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,20 @@
66

77
from ..._models import BaseModel
88

9-
__all__ = ["Company", "Logo", "OwnerUser", "SocialLink"]
9+
__all__ = ["Company", "FeaturedAffiliateProduct", "Logo", "OwnerUser", "SocialLink"]
10+
11+
12+
class FeaturedAffiliateProduct(BaseModel):
13+
"""The product featured for affiliates to promote on this company's affiliate page.
14+
15+
Null if none is configured.
16+
"""
17+
18+
id: str
19+
"""The unique identifier for the product."""
20+
21+
name: str
22+
"""The display name of the product shown to customers. Maximum 50 characters."""
1023

1124

1225
class Logo(BaseModel):
@@ -54,6 +67,12 @@ class Company(BaseModel):
5467
id: str
5568
"""The unique identifier for the company."""
5669

70+
affiliate_instructions: Optional[str] = None
71+
"""
72+
Guidelines and instructions provided to affiliates explaining how to promote
73+
this company's products.
74+
"""
75+
5776
created_at: datetime
5877
"""The datetime the company was created."""
5978

@@ -63,6 +82,12 @@ class Company(BaseModel):
6382
customers on the store page.
6483
"""
6584

85+
featured_affiliate_product: Optional[FeaturedAffiliateProduct] = None
86+
"""The product featured for affiliates to promote on this company's affiliate page.
87+
88+
Null if none is configured.
89+
"""
90+
6691
logo: Optional[Logo] = None
6792
"""The company's logo."""
6893

0 commit comments

Comments
 (0)