whop-sdk 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl
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.
Potentially problematic release.
This version of whop-sdk might be problematic. Click here for more details.
- whop_sdk/_client.py +47 -2
- whop_sdk/_version.py +1 -1
- whop_sdk/resources/__init__.py +70 -0
- whop_sdk/resources/checkout_configurations.py +4 -0
- whop_sdk/resources/course_chapters.py +602 -0
- whop_sdk/resources/course_lessons.py +722 -0
- whop_sdk/resources/courses.py +713 -0
- whop_sdk/resources/experiences.py +107 -0
- whop_sdk/resources/forum_posts.py +123 -1
- whop_sdk/resources/members.py +8 -0
- whop_sdk/resources/memberships.py +16 -8
- whop_sdk/resources/messages.py +113 -1
- whop_sdk/resources/payments.py +3 -26
- whop_sdk/resources/plans.py +74 -2
- whop_sdk/resources/products.py +8 -16
- whop_sdk/resources/promo_codes.py +652 -0
- whop_sdk/resources/reviews.py +315 -0
- whop_sdk/types/__init__.py +39 -0
- whop_sdk/types/assessment_question_types.py +7 -0
- whop_sdk/types/billing_reasons.py +9 -0
- whop_sdk/types/card_brands.py +24 -0
- whop_sdk/types/checkout_configuration_create_params.py +65 -2
- whop_sdk/types/checkout_configuration_list_response.py +4 -1
- whop_sdk/types/course.py +109 -0
- whop_sdk/types/course_chapter.py +32 -0
- whop_sdk/types/course_chapter_create_params.py +16 -0
- whop_sdk/types/course_chapter_delete_response.py +7 -0
- whop_sdk/types/course_chapter_list_params.py +25 -0
- whop_sdk/types/course_chapter_list_response.py +16 -0
- whop_sdk/types/course_chapter_update_params.py +12 -0
- whop_sdk/types/course_create_params.py +41 -0
- whop_sdk/types/course_delete_response.py +7 -0
- whop_sdk/types/course_lesson_create_params.py +27 -0
- whop_sdk/types/course_lesson_delete_response.py +7 -0
- whop_sdk/types/course_lesson_list_params.py +28 -0
- whop_sdk/types/course_lesson_list_response.py +35 -0
- whop_sdk/types/course_lesson_update_params.py +144 -0
- whop_sdk/types/course_list_params.py +28 -0
- whop_sdk/types/course_list_response.py +77 -0
- whop_sdk/types/course_update_params.py +89 -0
- whop_sdk/types/experience_duplicate_params.py +13 -0
- whop_sdk/types/forum_post_list_response.py +7 -0
- whop_sdk/types/forum_post_update_params.py +41 -0
- whop_sdk/types/languages.py +30 -0
- whop_sdk/types/ledger_account_retrieve_response.py +15 -1
- whop_sdk/types/lesson.py +159 -0
- whop_sdk/types/lesson_types.py +7 -0
- whop_sdk/types/lesson_visibilities.py +7 -0
- whop_sdk/types/member_list_params.py +3 -0
- whop_sdk/types/membership_list_params.py +7 -4
- whop_sdk/types/membership_list_response.py +12 -1
- whop_sdk/types/message_update_params.py +35 -0
- whop_sdk/types/payment_list_params.py +2 -7
- whop_sdk/types/payment_list_response.py +23 -13
- whop_sdk/types/payment_method_types.py +92 -0
- whop_sdk/types/plan_create_params.py +19 -1
- whop_sdk/types/plan_list_response.py +9 -0
- whop_sdk/types/plan_update_params.py +18 -0
- whop_sdk/types/product_create_params.py +1 -24
- whop_sdk/types/product_update_params.py +12 -1
- whop_sdk/types/promo_code.py +90 -0
- whop_sdk/types/promo_code_create_params.py +70 -0
- whop_sdk/types/promo_code_delete_response.py +7 -0
- whop_sdk/types/promo_code_list_params.py +37 -0
- whop_sdk/types/promo_code_list_response.py +79 -0
- whop_sdk/types/promo_code_status.py +7 -0
- whop_sdk/types/promo_duration.py +7 -0
- whop_sdk/types/review_list_params.py +31 -0
- whop_sdk/types/review_list_response.py +78 -0
- whop_sdk/types/review_retrieve_response.py +103 -0
- whop_sdk/types/review_status.py +7 -0
- whop_sdk/types/shared/checkout_configuration.py +4 -1
- whop_sdk/types/shared/forum_post.py +7 -0
- whop_sdk/types/shared/invoice.py +4 -1
- whop_sdk/types/shared/invoice_list_item.py +4 -1
- whop_sdk/types/shared/membership.py +12 -1
- whop_sdk/types/shared/payment.py +23 -13
- whop_sdk/types/shared/plan.py +9 -0
- whop_sdk/types/shared/product.py +8 -0
- whop_sdk/types/shared/product_list_item.py +8 -0
- whop_sdk/types/shared_params/__init__.py +1 -0
- whop_sdk/types/shared_params/promo_type.py +9 -0
- {whop_sdk-0.0.2.dist-info → whop_sdk-0.0.3.dist-info}/METADATA +1 -1
- {whop_sdk-0.0.2.dist-info → whop_sdk-0.0.3.dist-info}/RECORD +86 -41
- {whop_sdk-0.0.2.dist-info → whop_sdk-0.0.3.dist-info}/WHEEL +0 -0
- {whop_sdk-0.0.2.dist-info → whop_sdk-0.0.3.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
|
|
6
|
+
from .._models import BaseModel
|
|
7
|
+
from .review_status import ReviewStatus
|
|
8
|
+
|
|
9
|
+
__all__ = ["ReviewRetrieveResponse", "Attachment", "Company", "Product", "User"]
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Attachment(BaseModel):
|
|
13
|
+
id: str
|
|
14
|
+
"""The ID of the attachment"""
|
|
15
|
+
|
|
16
|
+
content_type: Optional[str] = None
|
|
17
|
+
"""The attachment's content type (e.g., image/jpg, video/mp4)"""
|
|
18
|
+
|
|
19
|
+
filename: Optional[str] = None
|
|
20
|
+
"""The name of the file"""
|
|
21
|
+
|
|
22
|
+
url: Optional[str] = None
|
|
23
|
+
"""This is the URL you use to render optimized attachments on the client.
|
|
24
|
+
|
|
25
|
+
This should be used for apps.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Company(BaseModel):
|
|
30
|
+
id: str
|
|
31
|
+
"""The ID (tag) of the company."""
|
|
32
|
+
|
|
33
|
+
route: str
|
|
34
|
+
"""The slug/route of the company on the Whop site."""
|
|
35
|
+
|
|
36
|
+
title: str
|
|
37
|
+
"""The title of the company."""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class Product(BaseModel):
|
|
41
|
+
id: str
|
|
42
|
+
"""The internal ID of the public product."""
|
|
43
|
+
|
|
44
|
+
title: str
|
|
45
|
+
"""The title of the product. Use for Whop 4.0."""
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class User(BaseModel):
|
|
49
|
+
id: str
|
|
50
|
+
"""The internal ID of the user."""
|
|
51
|
+
|
|
52
|
+
name: Optional[str] = None
|
|
53
|
+
"""The name of the user from their Whop account."""
|
|
54
|
+
|
|
55
|
+
username: str
|
|
56
|
+
"""The username of the user from their Whop account."""
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
class ReviewRetrieveResponse(BaseModel):
|
|
60
|
+
id: str
|
|
61
|
+
"""The internal ID of the review."""
|
|
62
|
+
|
|
63
|
+
attachments: List[Attachment]
|
|
64
|
+
"""The attachments attached to the review."""
|
|
65
|
+
|
|
66
|
+
company: Company
|
|
67
|
+
"""The company the review is for."""
|
|
68
|
+
|
|
69
|
+
created_at: datetime
|
|
70
|
+
"""The timestamp of when the review was created."""
|
|
71
|
+
|
|
72
|
+
description: Optional[str] = None
|
|
73
|
+
"""The description of the review."""
|
|
74
|
+
|
|
75
|
+
joined_at: Optional[datetime] = None
|
|
76
|
+
"""The timestamp of when the user joined the product."""
|
|
77
|
+
|
|
78
|
+
paid_for_product: Optional[bool] = None
|
|
79
|
+
"""Whether or not the user paid for the product.
|
|
80
|
+
|
|
81
|
+
If null, the payment status is unknown.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
product: Product
|
|
85
|
+
"""The product the review is for."""
|
|
86
|
+
|
|
87
|
+
published_at: Optional[datetime] = None
|
|
88
|
+
"""The timestamp of when the review was published."""
|
|
89
|
+
|
|
90
|
+
stars: int
|
|
91
|
+
"""The number of stars the user gave the product."""
|
|
92
|
+
|
|
93
|
+
status: ReviewStatus
|
|
94
|
+
"""The status of the review."""
|
|
95
|
+
|
|
96
|
+
title: Optional[str] = None
|
|
97
|
+
"""The title of the review."""
|
|
98
|
+
|
|
99
|
+
updated_at: datetime
|
|
100
|
+
"""The timestamp of when the review was last updated."""
|
|
101
|
+
|
|
102
|
+
user: User
|
|
103
|
+
"""The user account that performed the action."""
|
|
@@ -60,7 +60,10 @@ class CheckoutConfiguration(BaseModel):
|
|
|
60
60
|
"""The plan to use for the checkout configuration"""
|
|
61
61
|
|
|
62
62
|
purchase_url: str
|
|
63
|
-
"""
|
|
63
|
+
"""A URL you can send to customers to complete a checkout.
|
|
64
|
+
|
|
65
|
+
It looks like `/checkout/plan_xxxx?session={id}`
|
|
66
|
+
"""
|
|
64
67
|
|
|
65
68
|
redirect_url: Optional[str] = None
|
|
66
69
|
"""The URL to redirect the user to after the checkout configuration is created"""
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
from typing import Optional
|
|
4
|
+
from datetime import datetime
|
|
4
5
|
|
|
5
6
|
from ..._models import BaseModel
|
|
6
7
|
|
|
@@ -28,6 +29,9 @@ class ForumPost(BaseModel):
|
|
|
28
29
|
content: Optional[str] = None
|
|
29
30
|
"""The content of the forum post in Markdown format"""
|
|
30
31
|
|
|
32
|
+
created_at: datetime
|
|
33
|
+
"""The timestamp when the post was created"""
|
|
34
|
+
|
|
31
35
|
is_edited: bool
|
|
32
36
|
"""Whether the forum post has been edited"""
|
|
33
37
|
|
|
@@ -46,6 +50,9 @@ class ForumPost(BaseModel):
|
|
|
46
50
|
title: Optional[str] = None
|
|
47
51
|
"""The title of the forum post"""
|
|
48
52
|
|
|
53
|
+
updated_at: datetime
|
|
54
|
+
"""The timestamp when the post was last updated"""
|
|
55
|
+
|
|
49
56
|
user: User
|
|
50
57
|
"""The user who created this forum post"""
|
|
51
58
|
|
whop_sdk/types/shared/invoice.py
CHANGED
|
@@ -49,7 +49,10 @@ class Invoice(BaseModel):
|
|
|
49
49
|
"""The email address that the invoice was created for."""
|
|
50
50
|
|
|
51
51
|
fetch_invoice_token: str
|
|
52
|
-
"""
|
|
52
|
+
"""
|
|
53
|
+
A signed token that allows fetching the invoice data publically without being
|
|
54
|
+
authenticated.
|
|
55
|
+
"""
|
|
53
56
|
|
|
54
57
|
number: str
|
|
55
58
|
"""The number of the invoice."""
|
|
@@ -49,7 +49,10 @@ class InvoiceListItem(BaseModel):
|
|
|
49
49
|
"""The email address that the invoice was created for."""
|
|
50
50
|
|
|
51
51
|
fetch_invoice_token: str
|
|
52
|
-
"""
|
|
52
|
+
"""
|
|
53
|
+
A signed token that allows fetching the invoice data publically without being
|
|
54
|
+
authenticated.
|
|
55
|
+
"""
|
|
53
56
|
|
|
54
57
|
number: str
|
|
55
58
|
"""The number of the invoice."""
|
|
@@ -7,7 +7,7 @@ from .currency import Currency
|
|
|
7
7
|
from ..._models import BaseModel
|
|
8
8
|
from .membership_status import MembershipStatus
|
|
9
9
|
|
|
10
|
-
__all__ = ["Membership", "Company", "Member", "Plan", "PromoCode", "User"]
|
|
10
|
+
__all__ = ["Membership", "Company", "Member", "Plan", "Product", "PromoCode", "User"]
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Company(BaseModel):
|
|
@@ -28,6 +28,14 @@ class Plan(BaseModel):
|
|
|
28
28
|
"""The internal ID of the plan."""
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
class Product(BaseModel):
|
|
32
|
+
id: str
|
|
33
|
+
"""The internal ID of the public product."""
|
|
34
|
+
|
|
35
|
+
title: str
|
|
36
|
+
"""The title of the product. Use for Whop 4.0."""
|
|
37
|
+
|
|
38
|
+
|
|
31
39
|
class PromoCode(BaseModel):
|
|
32
40
|
id: str
|
|
33
41
|
"""The ID of the promo."""
|
|
@@ -92,6 +100,9 @@ class Membership(BaseModel):
|
|
|
92
100
|
plan: Plan
|
|
93
101
|
"""The Plan this Membership is for."""
|
|
94
102
|
|
|
103
|
+
product: Product
|
|
104
|
+
"""The Product this Membership grants access to."""
|
|
105
|
+
|
|
95
106
|
promo_code: Optional[PromoCode] = None
|
|
96
107
|
"""The Promo Code that is currently applied to this Membership."""
|
|
97
108
|
|
whop_sdk/types/shared/payment.py
CHANGED
|
@@ -6,8 +6,11 @@ from datetime import datetime
|
|
|
6
6
|
from .currency import Currency
|
|
7
7
|
from ..._models import BaseModel
|
|
8
8
|
from .promo_type import PromoType
|
|
9
|
+
from ..card_brands import CardBrands
|
|
9
10
|
from .receipt_status import ReceiptStatus
|
|
11
|
+
from ..billing_reasons import BillingReasons
|
|
10
12
|
from .membership_status import MembershipStatus
|
|
13
|
+
from ..payment_method_types import PaymentMethodTypes
|
|
11
14
|
from .friendly_receipt_status import FriendlyReceiptStatus
|
|
12
15
|
|
|
13
16
|
__all__ = ["Payment", "BillingAddress", "Company", "Member", "Membership", "Plan", "Product", "PromoCode", "User"]
|
|
@@ -93,7 +96,7 @@ class PromoCode(BaseModel):
|
|
|
93
96
|
"""The specific code used to apply the promo at checkout."""
|
|
94
97
|
|
|
95
98
|
number_of_intervals: Optional[int] = None
|
|
96
|
-
"""The number of
|
|
99
|
+
"""The number of months the promo is applied for."""
|
|
97
100
|
|
|
98
101
|
promo_type: PromoType
|
|
99
102
|
"""The type (% or flat amount) of the promo."""
|
|
@@ -126,11 +129,11 @@ class Payment(BaseModel):
|
|
|
126
129
|
billing_address: Optional[BillingAddress] = None
|
|
127
130
|
"""The address of the user who made the payment."""
|
|
128
131
|
|
|
129
|
-
billing_reason: Optional[
|
|
130
|
-
"""The
|
|
132
|
+
billing_reason: Optional[BillingReasons] = None
|
|
133
|
+
"""The reason why a specific payment was billed"""
|
|
131
134
|
|
|
132
|
-
card_brand: Optional[
|
|
133
|
-
"""
|
|
135
|
+
card_brand: Optional[CardBrands] = None
|
|
136
|
+
"""Possible card brands that a payment token can have"""
|
|
134
137
|
|
|
135
138
|
card_last4: Optional[str] = None
|
|
136
139
|
"""The last 4 digits of the card used to make the payment."""
|
|
@@ -162,11 +165,8 @@ class Payment(BaseModel):
|
|
|
162
165
|
paid_at: Optional[datetime] = None
|
|
163
166
|
"""The datetime the payment was paid"""
|
|
164
167
|
|
|
165
|
-
payment_method_type: Optional[
|
|
166
|
-
"""
|
|
167
|
-
|
|
168
|
-
Ex. klarna, affirm, card, cashapp
|
|
169
|
-
"""
|
|
168
|
+
payment_method_type: Optional[PaymentMethodTypes] = None
|
|
169
|
+
"""The different types of payment methods that can be used."""
|
|
170
170
|
|
|
171
171
|
plan: Optional[Plan] = None
|
|
172
172
|
"""The plan attached to this payment."""
|
|
@@ -178,7 +178,10 @@ class Payment(BaseModel):
|
|
|
178
178
|
"""The promo code used for this payment."""
|
|
179
179
|
|
|
180
180
|
refundable: bool
|
|
181
|
-
"""
|
|
181
|
+
"""
|
|
182
|
+
True only for payments that are `paid`, have not been fully refunded, and were
|
|
183
|
+
processed by a payment processor that allows refunds.
|
|
184
|
+
"""
|
|
182
185
|
|
|
183
186
|
refunded_amount: Optional[float] = None
|
|
184
187
|
"""The payment refund amount(if applicable)."""
|
|
@@ -187,7 +190,11 @@ class Payment(BaseModel):
|
|
|
187
190
|
"""When the payment was refunded (if applicable)."""
|
|
188
191
|
|
|
189
192
|
retryable: bool
|
|
190
|
-
"""
|
|
193
|
+
"""
|
|
194
|
+
True when the payment status is `open` and its membership is in one of the
|
|
195
|
+
retry-eligible states (`active`, `trialing`, `completed`, or `past_due`);
|
|
196
|
+
otherwise false. Used to decide if Whop can attempt the charge again.
|
|
197
|
+
"""
|
|
191
198
|
|
|
192
199
|
status: Optional[ReceiptStatus] = None
|
|
193
200
|
"""The status of a receipt"""
|
|
@@ -208,4 +215,7 @@ class Payment(BaseModel):
|
|
|
208
215
|
"""The user that made this payment."""
|
|
209
216
|
|
|
210
217
|
voidable: bool
|
|
211
|
-
"""
|
|
218
|
+
"""
|
|
219
|
+
True when the payment is tied to a membership in `past_due`, the payment status
|
|
220
|
+
is `open`, and the processor allows voiding payments; otherwise false.
|
|
221
|
+
"""
|
whop_sdk/types/shared/plan.py
CHANGED
|
@@ -110,12 +110,21 @@ class Plan(BaseModel):
|
|
|
110
110
|
renewal_price: float
|
|
111
111
|
"""The price a person has to pay for a plan on the renewal purchase."""
|
|
112
112
|
|
|
113
|
+
stock: Optional[int] = None
|
|
114
|
+
"""The number of units available for purchase. Only displayed to authorized actors"""
|
|
115
|
+
|
|
113
116
|
tax_type: TaxType
|
|
114
117
|
"""The tax type for the plan."""
|
|
115
118
|
|
|
119
|
+
title: Optional[str] = None
|
|
120
|
+
"""The title of the plan. This will be visible on the product page to customers."""
|
|
121
|
+
|
|
116
122
|
trial_period_days: Optional[int] = None
|
|
117
123
|
"""The number of free trial days added before a renewal plan."""
|
|
118
124
|
|
|
125
|
+
unlimited_stock: bool
|
|
126
|
+
"""Limits/doesn't limit the number of units available for purchase."""
|
|
127
|
+
|
|
119
128
|
updated_at: datetime
|
|
120
129
|
"""When the plan was last updated."""
|
|
121
130
|
|
whop_sdk/types/shared/product.py
CHANGED
|
@@ -72,6 +72,14 @@ class Product(BaseModel):
|
|
|
72
72
|
description: Optional[str] = None
|
|
73
73
|
"""A short description of what the company offers or does."""
|
|
74
74
|
|
|
75
|
+
external_identifier: Optional[str] = None
|
|
76
|
+
"""A unique identifier used to create or update products.
|
|
77
|
+
|
|
78
|
+
When provided on product creation endpoints, we’ll look up an existing product
|
|
79
|
+
by this identifier — if it exists, we’ll update it; if not, we’ll create a new
|
|
80
|
+
one.
|
|
81
|
+
"""
|
|
82
|
+
|
|
75
83
|
global_affiliate_percentage: Optional[float] = None
|
|
76
84
|
"""
|
|
77
85
|
The percentage of a transaction a user is eligible to earn from the whop
|
|
@@ -21,6 +21,14 @@ class ProductListItem(BaseModel):
|
|
|
21
21
|
created_at: datetime
|
|
22
22
|
"""When the product was created."""
|
|
23
23
|
|
|
24
|
+
external_identifier: Optional[str] = None
|
|
25
|
+
"""A unique identifier used to create or update products.
|
|
26
|
+
|
|
27
|
+
When provided on product creation endpoints, we’ll look up an existing product
|
|
28
|
+
by this identifier — if it exists, we’ll update it; if not, we’ll create a new
|
|
29
|
+
one.
|
|
30
|
+
"""
|
|
31
|
+
|
|
24
32
|
headline: Optional[str] = None
|
|
25
33
|
"""The headline of the product."""
|
|
26
34
|
|
|
@@ -5,6 +5,7 @@ from .tax_type import TaxType as TaxType
|
|
|
5
5
|
from .direction import Direction as Direction
|
|
6
6
|
from .plan_type import PlanType as PlanType
|
|
7
7
|
from .custom_cta import CustomCta as CustomCta
|
|
8
|
+
from .promo_type import PromoType as PromoType
|
|
8
9
|
from .visibility import Visibility as Visibility
|
|
9
10
|
from .access_level import AccessLevel as AccessLevel
|
|
10
11
|
from .app_statuses import AppStatuses as AppStatuses
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Literal, TypeAlias
|
|
6
|
+
|
|
7
|
+
__all__ = ["PromoType"]
|
|
8
|
+
|
|
9
|
+
PromoType: TypeAlias = Literal["percentage", "flat_amount"]
|