whop-sdk 0.0.1__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 +65 -2
- whop_sdk/_version.py +1 -1
- whop_sdk/resources/__init__.py +98 -0
- whop_sdk/resources/checkout_configurations.py +16 -12
- 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/forums.py +446 -0
- whop_sdk/resources/members.py +429 -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 +84 -6
- 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 +64 -0
- whop_sdk/types/app_list_response.py +16 -1
- 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 +70 -7
- whop_sdk/types/checkout_configuration_list_response.py +12 -9
- 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_interaction_completed_webhook_event.py +26 -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/entry_approved_webhook_event.py +26 -0
- whop_sdk/types/entry_created_webhook_event.py +26 -0
- whop_sdk/types/entry_deleted_webhook_event.py +26 -0
- whop_sdk/types/entry_denied_webhook_event.py +26 -0
- whop_sdk/types/experience_duplicate_params.py +13 -0
- whop_sdk/types/experience_list_response.py +27 -1
- whop_sdk/types/forum_list_params.py +28 -0
- whop_sdk/types/forum_list_response.py +33 -0
- whop_sdk/types/forum_post_list_response.py +7 -0
- whop_sdk/types/forum_post_update_params.py +41 -0
- whop_sdk/types/forum_update_params.py +23 -0
- whop_sdk/types/invoice_create_params.py +10 -2
- 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 +73 -0
- whop_sdk/types/member_list_response.py +65 -0
- whop_sdk/types/member_retrieve_response.py +79 -0
- whop_sdk/types/membership_activated_webhook_event.py +29 -0
- whop_sdk/types/membership_deactivated_webhook_event.py +29 -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_failed_webhook_event.py +26 -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/payment_pending_webhook_event.py +26 -0
- whop_sdk/types/payment_succeeded_webhook_event.py +26 -0
- whop_sdk/types/plan_create_params.py +29 -3
- 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/__init__.py +7 -0
- whop_sdk/types/shared/access_level.py +7 -0
- whop_sdk/types/shared/app.py +25 -1
- whop_sdk/types/shared/checkout_configuration.py +12 -9
- whop_sdk/types/shared/company.py +15 -1
- whop_sdk/types/shared/course_lesson_interaction.py +20 -1
- whop_sdk/types/shared/email_notification_preferences.py +7 -0
- whop_sdk/types/shared/experience.py +27 -1
- whop_sdk/types/shared/forum.py +33 -0
- 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/member_most_recent_actions.py +22 -0
- whop_sdk/types/shared/member_statuses.py +7 -0
- 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/who_can_comment_types.py +7 -0
- whop_sdk/types/shared/who_can_post_types.py +7 -0
- whop_sdk/types/shared_params/__init__.py +7 -0
- whop_sdk/types/shared_params/access_level.py +9 -0
- whop_sdk/types/shared_params/email_notification_preferences.py +9 -0
- whop_sdk/types/shared_params/member_most_recent_actions.py +24 -0
- whop_sdk/types/shared_params/member_statuses.py +9 -0
- whop_sdk/types/shared_params/promo_type.py +9 -0
- whop_sdk/types/shared_params/who_can_comment_types.py +9 -0
- whop_sdk/types/shared_params/who_can_post_types.py +9 -0
- whop_sdk/types/unwrap_webhook_event.py +24 -1
- whop_sdk/types/user_check_access_response.py +2 -3
- whop_sdk/types/user_retrieve_response.py +12 -1
- {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.3.dist-info}/METADATA +2 -2
- {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.3.dist-info}/RECORD +126 -50
- {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.3.dist-info}/WHEEL +0 -0
- {whop_sdk-0.0.1.dist-info → whop_sdk-0.0.3.dist-info}/licenses/LICENSE +0 -0
whop_sdk/resources/messages.py
CHANGED
|
@@ -6,7 +6,7 @@ from typing import Iterable, Optional
|
|
|
6
6
|
|
|
7
7
|
import httpx
|
|
8
8
|
|
|
9
|
-
from ..types import message_list_params, message_create_params
|
|
9
|
+
from ..types import message_list_params, message_create_params, message_update_params
|
|
10
10
|
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
11
11
|
from .._utils import maybe_transform, async_maybe_transform
|
|
12
12
|
from .._compat import cached_property
|
|
@@ -138,6 +138,56 @@ class MessagesResource(SyncAPIResource):
|
|
|
138
138
|
cast_to=Message,
|
|
139
139
|
)
|
|
140
140
|
|
|
141
|
+
def update(
|
|
142
|
+
self,
|
|
143
|
+
id: str,
|
|
144
|
+
*,
|
|
145
|
+
attachments: Optional[Iterable[message_update_params.Attachment]] | Omit = omit,
|
|
146
|
+
content: Optional[str] | Omit = omit,
|
|
147
|
+
is_pinned: Optional[bool] | Omit = omit,
|
|
148
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
149
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
150
|
+
extra_headers: Headers | None = None,
|
|
151
|
+
extra_query: Query | None = None,
|
|
152
|
+
extra_body: Body | None = None,
|
|
153
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
154
|
+
) -> Message:
|
|
155
|
+
"""
|
|
156
|
+
Updates an existing message
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
attachments: The attachments for this message
|
|
160
|
+
|
|
161
|
+
content: The content of the message in Markdown format
|
|
162
|
+
|
|
163
|
+
is_pinned: Whether this message is pinned
|
|
164
|
+
|
|
165
|
+
extra_headers: Send extra headers
|
|
166
|
+
|
|
167
|
+
extra_query: Add additional query parameters to the request
|
|
168
|
+
|
|
169
|
+
extra_body: Add additional JSON properties to the request
|
|
170
|
+
|
|
171
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
172
|
+
"""
|
|
173
|
+
if not id:
|
|
174
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
175
|
+
return self._patch(
|
|
176
|
+
f"/messages/{id}",
|
|
177
|
+
body=maybe_transform(
|
|
178
|
+
{
|
|
179
|
+
"attachments": attachments,
|
|
180
|
+
"content": content,
|
|
181
|
+
"is_pinned": is_pinned,
|
|
182
|
+
},
|
|
183
|
+
message_update_params.MessageUpdateParams,
|
|
184
|
+
),
|
|
185
|
+
options=make_request_options(
|
|
186
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
187
|
+
),
|
|
188
|
+
cast_to=Message,
|
|
189
|
+
)
|
|
190
|
+
|
|
141
191
|
def list(
|
|
142
192
|
self,
|
|
143
193
|
*,
|
|
@@ -318,6 +368,56 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
|
318
368
|
cast_to=Message,
|
|
319
369
|
)
|
|
320
370
|
|
|
371
|
+
async def update(
|
|
372
|
+
self,
|
|
373
|
+
id: str,
|
|
374
|
+
*,
|
|
375
|
+
attachments: Optional[Iterable[message_update_params.Attachment]] | Omit = omit,
|
|
376
|
+
content: Optional[str] | Omit = omit,
|
|
377
|
+
is_pinned: Optional[bool] | Omit = omit,
|
|
378
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
379
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
380
|
+
extra_headers: Headers | None = None,
|
|
381
|
+
extra_query: Query | None = None,
|
|
382
|
+
extra_body: Body | None = None,
|
|
383
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
384
|
+
) -> Message:
|
|
385
|
+
"""
|
|
386
|
+
Updates an existing message
|
|
387
|
+
|
|
388
|
+
Args:
|
|
389
|
+
attachments: The attachments for this message
|
|
390
|
+
|
|
391
|
+
content: The content of the message in Markdown format
|
|
392
|
+
|
|
393
|
+
is_pinned: Whether this message is pinned
|
|
394
|
+
|
|
395
|
+
extra_headers: Send extra headers
|
|
396
|
+
|
|
397
|
+
extra_query: Add additional query parameters to the request
|
|
398
|
+
|
|
399
|
+
extra_body: Add additional JSON properties to the request
|
|
400
|
+
|
|
401
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
402
|
+
"""
|
|
403
|
+
if not id:
|
|
404
|
+
raise ValueError(f"Expected a non-empty value for `id` but received {id!r}")
|
|
405
|
+
return await self._patch(
|
|
406
|
+
f"/messages/{id}",
|
|
407
|
+
body=await async_maybe_transform(
|
|
408
|
+
{
|
|
409
|
+
"attachments": attachments,
|
|
410
|
+
"content": content,
|
|
411
|
+
"is_pinned": is_pinned,
|
|
412
|
+
},
|
|
413
|
+
message_update_params.MessageUpdateParams,
|
|
414
|
+
),
|
|
415
|
+
options=make_request_options(
|
|
416
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
417
|
+
),
|
|
418
|
+
cast_to=Message,
|
|
419
|
+
)
|
|
420
|
+
|
|
321
421
|
def list(
|
|
322
422
|
self,
|
|
323
423
|
*,
|
|
@@ -396,6 +496,9 @@ class MessagesResourceWithRawResponse:
|
|
|
396
496
|
self.retrieve = to_raw_response_wrapper(
|
|
397
497
|
messages.retrieve,
|
|
398
498
|
)
|
|
499
|
+
self.update = to_raw_response_wrapper(
|
|
500
|
+
messages.update,
|
|
501
|
+
)
|
|
399
502
|
self.list = to_raw_response_wrapper(
|
|
400
503
|
messages.list,
|
|
401
504
|
)
|
|
@@ -411,6 +514,9 @@ class AsyncMessagesResourceWithRawResponse:
|
|
|
411
514
|
self.retrieve = async_to_raw_response_wrapper(
|
|
412
515
|
messages.retrieve,
|
|
413
516
|
)
|
|
517
|
+
self.update = async_to_raw_response_wrapper(
|
|
518
|
+
messages.update,
|
|
519
|
+
)
|
|
414
520
|
self.list = async_to_raw_response_wrapper(
|
|
415
521
|
messages.list,
|
|
416
522
|
)
|
|
@@ -426,6 +532,9 @@ class MessagesResourceWithStreamingResponse:
|
|
|
426
532
|
self.retrieve = to_streamed_response_wrapper(
|
|
427
533
|
messages.retrieve,
|
|
428
534
|
)
|
|
535
|
+
self.update = to_streamed_response_wrapper(
|
|
536
|
+
messages.update,
|
|
537
|
+
)
|
|
429
538
|
self.list = to_streamed_response_wrapper(
|
|
430
539
|
messages.list,
|
|
431
540
|
)
|
|
@@ -441,6 +550,9 @@ class AsyncMessagesResourceWithStreamingResponse:
|
|
|
441
550
|
self.retrieve = async_to_streamed_response_wrapper(
|
|
442
551
|
messages.retrieve,
|
|
443
552
|
)
|
|
553
|
+
self.update = async_to_streamed_response_wrapper(
|
|
554
|
+
messages.update,
|
|
555
|
+
)
|
|
444
556
|
self.list = async_to_streamed_response_wrapper(
|
|
445
557
|
messages.list,
|
|
446
558
|
)
|
whop_sdk/resources/payments.py
CHANGED
|
@@ -22,6 +22,7 @@ from .._response import (
|
|
|
22
22
|
from ..pagination import SyncCursorPage, AsyncCursorPage
|
|
23
23
|
from .._base_client import AsyncPaginator, make_request_options
|
|
24
24
|
from ..types.shared.payment import Payment
|
|
25
|
+
from ..types.billing_reasons import BillingReasons
|
|
25
26
|
from ..types.shared.currency import Currency
|
|
26
27
|
from ..types.shared.direction import Direction
|
|
27
28
|
from ..types.payment_list_response import PaymentListResponse
|
|
@@ -100,19 +101,7 @@ class PaymentsResource(SyncAPIResource):
|
|
|
100
101
|
company_id: str,
|
|
101
102
|
after: Optional[str] | Omit = omit,
|
|
102
103
|
before: Optional[str] | Omit = omit,
|
|
103
|
-
billing_reasons: Optional[
|
|
104
|
-
List[
|
|
105
|
-
Literal[
|
|
106
|
-
"subscription_create",
|
|
107
|
-
"subscription_cycle",
|
|
108
|
-
"subscription_update",
|
|
109
|
-
"one_time",
|
|
110
|
-
"manual",
|
|
111
|
-
"subscription",
|
|
112
|
-
]
|
|
113
|
-
]
|
|
114
|
-
]
|
|
115
|
-
| Omit = omit,
|
|
104
|
+
billing_reasons: Optional[List[BillingReasons]] | Omit = omit,
|
|
116
105
|
created_after: Union[str, datetime, None] | Omit = omit,
|
|
117
106
|
created_before: Union[str, datetime, None] | Omit = omit,
|
|
118
107
|
currencies: Optional[List[Currency]] | Omit = omit,
|
|
@@ -422,19 +411,7 @@ class AsyncPaymentsResource(AsyncAPIResource):
|
|
|
422
411
|
company_id: str,
|
|
423
412
|
after: Optional[str] | Omit = omit,
|
|
424
413
|
before: Optional[str] | Omit = omit,
|
|
425
|
-
billing_reasons: Optional[
|
|
426
|
-
List[
|
|
427
|
-
Literal[
|
|
428
|
-
"subscription_create",
|
|
429
|
-
"subscription_cycle",
|
|
430
|
-
"subscription_update",
|
|
431
|
-
"one_time",
|
|
432
|
-
"manual",
|
|
433
|
-
"subscription",
|
|
434
|
-
]
|
|
435
|
-
]
|
|
436
|
-
]
|
|
437
|
-
| Omit = omit,
|
|
414
|
+
billing_reasons: Optional[List[BillingReasons]] | Omit = omit,
|
|
438
415
|
created_after: Union[str, datetime, None] | Omit = omit,
|
|
439
416
|
created_before: Union[str, datetime, None] | Omit = omit,
|
|
440
417
|
currencies: Optional[List[Currency]] | Omit = omit,
|
whop_sdk/resources/plans.py
CHANGED
|
@@ -71,8 +71,12 @@ class PlansResource(SyncAPIResource):
|
|
|
71
71
|
plan_type: Optional[PlanType] | Omit = omit,
|
|
72
72
|
release_method: Optional[ReleaseMethod] | Omit = omit,
|
|
73
73
|
renewal_price: Optional[float] | Omit = omit,
|
|
74
|
+
stock: Optional[int] | Omit = omit,
|
|
75
|
+
strike_through_initial_price: Optional[float] | Omit = omit,
|
|
76
|
+
strike_through_renewal_price: Optional[float] | Omit = omit,
|
|
74
77
|
title: Optional[str] | Omit = omit,
|
|
75
78
|
trial_period_days: Optional[int] | Omit = omit,
|
|
79
|
+
unlimited_stock: Optional[bool] | Omit = omit,
|
|
76
80
|
visibility: Optional[Visibility] | Omit = omit,
|
|
77
81
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
78
82
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -95,7 +99,7 @@ class PlansResource(SyncAPIResource):
|
|
|
95
99
|
|
|
96
100
|
product_id: The product the plan is related to.
|
|
97
101
|
|
|
98
|
-
billing_period: The interval at which the plan charges (renewal plans).
|
|
102
|
+
billing_period: The interval in days at which the plan charges (renewal plans).
|
|
99
103
|
|
|
100
104
|
currency: The available currencies on the platform
|
|
101
105
|
|
|
@@ -107,7 +111,9 @@ class PlansResource(SyncAPIResource):
|
|
|
107
111
|
|
|
108
112
|
image: An image for the plan. This will be visible on the product page to customers.
|
|
109
113
|
|
|
110
|
-
initial_price: An additional amount charged upon first purchase.
|
|
114
|
+
initial_price: An additional amount charged upon first purchase. Use only if a one time payment
|
|
115
|
+
OR you want to charge an additional amount on top of the renewal price. Provided
|
|
116
|
+
as a number in dollars. Eg: 10.43 for $10.43
|
|
111
117
|
|
|
112
118
|
internal_notes: A personal description or notes section for the business.
|
|
113
119
|
|
|
@@ -118,12 +124,23 @@ class PlansResource(SyncAPIResource):
|
|
|
118
124
|
|
|
119
125
|
release_method: The methods of how a plan can be released.
|
|
120
126
|
|
|
121
|
-
renewal_price: The amount the customer is charged every billing period.
|
|
127
|
+
renewal_price: The amount the customer is charged every billing period. Use only if a recurring
|
|
128
|
+
payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
129
|
+
|
|
130
|
+
stock: The number of units available for purchase.
|
|
131
|
+
|
|
132
|
+
strike_through_initial_price: The price to display with a strikethrough for the initial price. Provided as a
|
|
133
|
+
number in dollars. Eg: 19.99 for $19.99
|
|
134
|
+
|
|
135
|
+
strike_through_renewal_price: The price to display with a strikethrough for the renewal price. Provided as a
|
|
136
|
+
number in dollars. Eg: 19.99 for $19.99
|
|
122
137
|
|
|
123
138
|
title: The title of the plan. This will be visible on the product page to customers.
|
|
124
139
|
|
|
125
140
|
trial_period_days: The number of free trial days added before a renewal plan.
|
|
126
141
|
|
|
142
|
+
unlimited_stock: Limits/doesn't limit the number of units available for purchase.
|
|
143
|
+
|
|
127
144
|
visibility: Visibility of a resource
|
|
128
145
|
|
|
129
146
|
extra_headers: Send extra headers
|
|
@@ -152,8 +169,12 @@ class PlansResource(SyncAPIResource):
|
|
|
152
169
|
"plan_type": plan_type,
|
|
153
170
|
"release_method": release_method,
|
|
154
171
|
"renewal_price": renewal_price,
|
|
172
|
+
"stock": stock,
|
|
173
|
+
"strike_through_initial_price": strike_through_initial_price,
|
|
174
|
+
"strike_through_renewal_price": strike_through_renewal_price,
|
|
155
175
|
"title": title,
|
|
156
176
|
"trial_period_days": trial_period_days,
|
|
177
|
+
"unlimited_stock": unlimited_stock,
|
|
157
178
|
"visibility": visibility,
|
|
158
179
|
},
|
|
159
180
|
plan_create_params.PlanCreateParams,
|
|
@@ -216,8 +237,12 @@ class PlansResource(SyncAPIResource):
|
|
|
216
237
|
offer_cancel_discount: Optional[bool] | Omit = omit,
|
|
217
238
|
override_tax_type: Optional[TaxType] | Omit = omit,
|
|
218
239
|
renewal_price: Optional[float] | Omit = omit,
|
|
240
|
+
stock: Optional[int] | Omit = omit,
|
|
241
|
+
strike_through_initial_price: Optional[float] | Omit = omit,
|
|
242
|
+
strike_through_renewal_price: Optional[float] | Omit = omit,
|
|
219
243
|
title: Optional[str] | Omit = omit,
|
|
220
244
|
trial_period_days: Optional[int] | Omit = omit,
|
|
245
|
+
unlimited_stock: Optional[bool] | Omit = omit,
|
|
221
246
|
visibility: Optional[Visibility] | Omit = omit,
|
|
222
247
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
223
248
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -259,10 +284,20 @@ class PlansResource(SyncAPIResource):
|
|
|
259
284
|
|
|
260
285
|
renewal_price: The amount the customer is charged every billing period.
|
|
261
286
|
|
|
287
|
+
stock: The number of units available for purchase.
|
|
288
|
+
|
|
289
|
+
strike_through_initial_price: The price to display with a strikethrough for the initial price. Provided as a
|
|
290
|
+
number in dollars. Eg: 19.99 for $19.99
|
|
291
|
+
|
|
292
|
+
strike_through_renewal_price: The price to display with a strikethrough for the renewal price. Provided as a
|
|
293
|
+
number in dollars. Eg: 19.99 for $19.99
|
|
294
|
+
|
|
262
295
|
title: The title of the plan. This will be visible on the product page to customers.
|
|
263
296
|
|
|
264
297
|
trial_period_days: The number of free trial days added before a renewal plan.
|
|
265
298
|
|
|
299
|
+
unlimited_stock: Limits/doesn't limit the number of units available for purchase.
|
|
300
|
+
|
|
266
301
|
visibility: Visibility of a resource
|
|
267
302
|
|
|
268
303
|
extra_headers: Send extra headers
|
|
@@ -290,8 +325,12 @@ class PlansResource(SyncAPIResource):
|
|
|
290
325
|
"offer_cancel_discount": offer_cancel_discount,
|
|
291
326
|
"override_tax_type": override_tax_type,
|
|
292
327
|
"renewal_price": renewal_price,
|
|
328
|
+
"stock": stock,
|
|
329
|
+
"strike_through_initial_price": strike_through_initial_price,
|
|
330
|
+
"strike_through_renewal_price": strike_through_renewal_price,
|
|
293
331
|
"title": title,
|
|
294
332
|
"trial_period_days": trial_period_days,
|
|
333
|
+
"unlimited_stock": unlimited_stock,
|
|
295
334
|
"visibility": visibility,
|
|
296
335
|
},
|
|
297
336
|
plan_update_params.PlanUpdateParams,
|
|
@@ -465,8 +504,12 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
465
504
|
plan_type: Optional[PlanType] | Omit = omit,
|
|
466
505
|
release_method: Optional[ReleaseMethod] | Omit = omit,
|
|
467
506
|
renewal_price: Optional[float] | Omit = omit,
|
|
507
|
+
stock: Optional[int] | Omit = omit,
|
|
508
|
+
strike_through_initial_price: Optional[float] | Omit = omit,
|
|
509
|
+
strike_through_renewal_price: Optional[float] | Omit = omit,
|
|
468
510
|
title: Optional[str] | Omit = omit,
|
|
469
511
|
trial_period_days: Optional[int] | Omit = omit,
|
|
512
|
+
unlimited_stock: Optional[bool] | Omit = omit,
|
|
470
513
|
visibility: Optional[Visibility] | Omit = omit,
|
|
471
514
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
472
515
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -489,7 +532,7 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
489
532
|
|
|
490
533
|
product_id: The product the plan is related to.
|
|
491
534
|
|
|
492
|
-
billing_period: The interval at which the plan charges (renewal plans).
|
|
535
|
+
billing_period: The interval in days at which the plan charges (renewal plans).
|
|
493
536
|
|
|
494
537
|
currency: The available currencies on the platform
|
|
495
538
|
|
|
@@ -501,7 +544,9 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
501
544
|
|
|
502
545
|
image: An image for the plan. This will be visible on the product page to customers.
|
|
503
546
|
|
|
504
|
-
initial_price: An additional amount charged upon first purchase.
|
|
547
|
+
initial_price: An additional amount charged upon first purchase. Use only if a one time payment
|
|
548
|
+
OR you want to charge an additional amount on top of the renewal price. Provided
|
|
549
|
+
as a number in dollars. Eg: 10.43 for $10.43
|
|
505
550
|
|
|
506
551
|
internal_notes: A personal description or notes section for the business.
|
|
507
552
|
|
|
@@ -512,12 +557,23 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
512
557
|
|
|
513
558
|
release_method: The methods of how a plan can be released.
|
|
514
559
|
|
|
515
|
-
renewal_price: The amount the customer is charged every billing period.
|
|
560
|
+
renewal_price: The amount the customer is charged every billing period. Use only if a recurring
|
|
561
|
+
payment. Provided as a number in dollars. Eg: 10.43 for $10.43
|
|
562
|
+
|
|
563
|
+
stock: The number of units available for purchase.
|
|
564
|
+
|
|
565
|
+
strike_through_initial_price: The price to display with a strikethrough for the initial price. Provided as a
|
|
566
|
+
number in dollars. Eg: 19.99 for $19.99
|
|
567
|
+
|
|
568
|
+
strike_through_renewal_price: The price to display with a strikethrough for the renewal price. Provided as a
|
|
569
|
+
number in dollars. Eg: 19.99 for $19.99
|
|
516
570
|
|
|
517
571
|
title: The title of the plan. This will be visible on the product page to customers.
|
|
518
572
|
|
|
519
573
|
trial_period_days: The number of free trial days added before a renewal plan.
|
|
520
574
|
|
|
575
|
+
unlimited_stock: Limits/doesn't limit the number of units available for purchase.
|
|
576
|
+
|
|
521
577
|
visibility: Visibility of a resource
|
|
522
578
|
|
|
523
579
|
extra_headers: Send extra headers
|
|
@@ -546,8 +602,12 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
546
602
|
"plan_type": plan_type,
|
|
547
603
|
"release_method": release_method,
|
|
548
604
|
"renewal_price": renewal_price,
|
|
605
|
+
"stock": stock,
|
|
606
|
+
"strike_through_initial_price": strike_through_initial_price,
|
|
607
|
+
"strike_through_renewal_price": strike_through_renewal_price,
|
|
549
608
|
"title": title,
|
|
550
609
|
"trial_period_days": trial_period_days,
|
|
610
|
+
"unlimited_stock": unlimited_stock,
|
|
551
611
|
"visibility": visibility,
|
|
552
612
|
},
|
|
553
613
|
plan_create_params.PlanCreateParams,
|
|
@@ -610,8 +670,12 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
610
670
|
offer_cancel_discount: Optional[bool] | Omit = omit,
|
|
611
671
|
override_tax_type: Optional[TaxType] | Omit = omit,
|
|
612
672
|
renewal_price: Optional[float] | Omit = omit,
|
|
673
|
+
stock: Optional[int] | Omit = omit,
|
|
674
|
+
strike_through_initial_price: Optional[float] | Omit = omit,
|
|
675
|
+
strike_through_renewal_price: Optional[float] | Omit = omit,
|
|
613
676
|
title: Optional[str] | Omit = omit,
|
|
614
677
|
trial_period_days: Optional[int] | Omit = omit,
|
|
678
|
+
unlimited_stock: Optional[bool] | Omit = omit,
|
|
615
679
|
visibility: Optional[Visibility] | Omit = omit,
|
|
616
680
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
617
681
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
@@ -653,10 +717,20 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
653
717
|
|
|
654
718
|
renewal_price: The amount the customer is charged every billing period.
|
|
655
719
|
|
|
720
|
+
stock: The number of units available for purchase.
|
|
721
|
+
|
|
722
|
+
strike_through_initial_price: The price to display with a strikethrough for the initial price. Provided as a
|
|
723
|
+
number in dollars. Eg: 19.99 for $19.99
|
|
724
|
+
|
|
725
|
+
strike_through_renewal_price: The price to display with a strikethrough for the renewal price. Provided as a
|
|
726
|
+
number in dollars. Eg: 19.99 for $19.99
|
|
727
|
+
|
|
656
728
|
title: The title of the plan. This will be visible on the product page to customers.
|
|
657
729
|
|
|
658
730
|
trial_period_days: The number of free trial days added before a renewal plan.
|
|
659
731
|
|
|
732
|
+
unlimited_stock: Limits/doesn't limit the number of units available for purchase.
|
|
733
|
+
|
|
660
734
|
visibility: Visibility of a resource
|
|
661
735
|
|
|
662
736
|
extra_headers: Send extra headers
|
|
@@ -684,8 +758,12 @@ class AsyncPlansResource(AsyncAPIResource):
|
|
|
684
758
|
"offer_cancel_discount": offer_cancel_discount,
|
|
685
759
|
"override_tax_type": override_tax_type,
|
|
686
760
|
"renewal_price": renewal_price,
|
|
761
|
+
"stock": stock,
|
|
762
|
+
"strike_through_initial_price": strike_through_initial_price,
|
|
763
|
+
"strike_through_renewal_price": strike_through_renewal_price,
|
|
687
764
|
"title": title,
|
|
688
765
|
"trial_period_days": trial_period_days,
|
|
766
|
+
"unlimited_stock": unlimited_stock,
|
|
689
767
|
"visibility": visibility,
|
|
690
768
|
},
|
|
691
769
|
plan_update_params.PlanUpdateParams,
|
whop_sdk/resources/products.py
CHANGED
|
@@ -60,8 +60,6 @@ class ProductsResource(SyncAPIResource):
|
|
|
60
60
|
*,
|
|
61
61
|
company_id: str,
|
|
62
62
|
title: str,
|
|
63
|
-
access_pass_type: Optional[AccessPassType] | Omit = omit,
|
|
64
|
-
banner_image: Optional[product_create_params.BannerImage] | Omit = omit,
|
|
65
63
|
business_type: Optional[BusinessTypes] | Omit = omit,
|
|
66
64
|
collect_shipping_address: Optional[bool] | Omit = omit,
|
|
67
65
|
custom_cta: Optional[CustomCta] | Omit = omit,
|
|
@@ -101,10 +99,6 @@ class ProductsResource(SyncAPIResource):
|
|
|
101
99
|
|
|
102
100
|
title: The title of the product.
|
|
103
101
|
|
|
104
|
-
access_pass_type: The different types an access pass can be.
|
|
105
|
-
|
|
106
|
-
banner_image: A banner image for the product in png, jpeg format
|
|
107
|
-
|
|
108
102
|
business_type: The different business types a company can be.
|
|
109
103
|
|
|
110
104
|
collect_shipping_address: Whether or not to collect shipping information at checkout from the customer.
|
|
@@ -159,8 +153,6 @@ class ProductsResource(SyncAPIResource):
|
|
|
159
153
|
{
|
|
160
154
|
"company_id": company_id,
|
|
161
155
|
"title": title,
|
|
162
|
-
"access_pass_type": access_pass_type,
|
|
163
|
-
"banner_image": banner_image,
|
|
164
156
|
"business_type": business_type,
|
|
165
157
|
"collect_shipping_address": collect_shipping_address,
|
|
166
158
|
"custom_cta": custom_cta,
|
|
@@ -246,6 +238,7 @@ class ProductsResource(SyncAPIResource):
|
|
|
246
238
|
product_tax_code_id: Optional[str] | Omit = omit,
|
|
247
239
|
redirect_purchase_url: Optional[str] | Omit = omit,
|
|
248
240
|
route: Optional[str] | Omit = omit,
|
|
241
|
+
store_page_config: Optional[product_update_params.StorePageConfig] | Omit = omit,
|
|
249
242
|
title: Optional[str] | Omit = omit,
|
|
250
243
|
visibility: Optional[Visibility] | Omit = omit,
|
|
251
244
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -298,6 +291,8 @@ class ProductsResource(SyncAPIResource):
|
|
|
298
291
|
|
|
299
292
|
route: The route of the product.
|
|
300
293
|
|
|
294
|
+
store_page_config: Configuration for a product on the company's store page.
|
|
295
|
+
|
|
301
296
|
title: The title of the product.
|
|
302
297
|
|
|
303
298
|
visibility: Visibility of a resource
|
|
@@ -332,6 +327,7 @@ class ProductsResource(SyncAPIResource):
|
|
|
332
327
|
"product_tax_code_id": product_tax_code_id,
|
|
333
328
|
"redirect_purchase_url": redirect_purchase_url,
|
|
334
329
|
"route": route,
|
|
330
|
+
"store_page_config": store_page_config,
|
|
335
331
|
"title": title,
|
|
336
332
|
"visibility": visibility,
|
|
337
333
|
},
|
|
@@ -485,8 +481,6 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
485
481
|
*,
|
|
486
482
|
company_id: str,
|
|
487
483
|
title: str,
|
|
488
|
-
access_pass_type: Optional[AccessPassType] | Omit = omit,
|
|
489
|
-
banner_image: Optional[product_create_params.BannerImage] | Omit = omit,
|
|
490
484
|
business_type: Optional[BusinessTypes] | Omit = omit,
|
|
491
485
|
collect_shipping_address: Optional[bool] | Omit = omit,
|
|
492
486
|
custom_cta: Optional[CustomCta] | Omit = omit,
|
|
@@ -526,10 +520,6 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
526
520
|
|
|
527
521
|
title: The title of the product.
|
|
528
522
|
|
|
529
|
-
access_pass_type: The different types an access pass can be.
|
|
530
|
-
|
|
531
|
-
banner_image: A banner image for the product in png, jpeg format
|
|
532
|
-
|
|
533
523
|
business_type: The different business types a company can be.
|
|
534
524
|
|
|
535
525
|
collect_shipping_address: Whether or not to collect shipping information at checkout from the customer.
|
|
@@ -584,8 +574,6 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
584
574
|
{
|
|
585
575
|
"company_id": company_id,
|
|
586
576
|
"title": title,
|
|
587
|
-
"access_pass_type": access_pass_type,
|
|
588
|
-
"banner_image": banner_image,
|
|
589
577
|
"business_type": business_type,
|
|
590
578
|
"collect_shipping_address": collect_shipping_address,
|
|
591
579
|
"custom_cta": custom_cta,
|
|
@@ -671,6 +659,7 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
671
659
|
product_tax_code_id: Optional[str] | Omit = omit,
|
|
672
660
|
redirect_purchase_url: Optional[str] | Omit = omit,
|
|
673
661
|
route: Optional[str] | Omit = omit,
|
|
662
|
+
store_page_config: Optional[product_update_params.StorePageConfig] | Omit = omit,
|
|
674
663
|
title: Optional[str] | Omit = omit,
|
|
675
664
|
visibility: Optional[Visibility] | Omit = omit,
|
|
676
665
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
@@ -723,6 +712,8 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
723
712
|
|
|
724
713
|
route: The route of the product.
|
|
725
714
|
|
|
715
|
+
store_page_config: Configuration for a product on the company's store page.
|
|
716
|
+
|
|
726
717
|
title: The title of the product.
|
|
727
718
|
|
|
728
719
|
visibility: Visibility of a resource
|
|
@@ -757,6 +748,7 @@ class AsyncProductsResource(AsyncAPIResource):
|
|
|
757
748
|
"product_tax_code_id": product_tax_code_id,
|
|
758
749
|
"redirect_purchase_url": redirect_purchase_url,
|
|
759
750
|
"route": route,
|
|
751
|
+
"store_page_config": store_page_config,
|
|
760
752
|
"title": title,
|
|
761
753
|
"visibility": visibility,
|
|
762
754
|
},
|