Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.37"
".": "0.1.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 195
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-58749e1928f402cc3e236d38b53bce3b10530bfaccbe426181bba9b1bfc42498.yml
openapi_spec_hash: ecea6e6c4b93665aee5554839a26ded8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/frostedinc%2Fwhopsdk-60ba848b6e2ccbd787b931cda96c66670852c91c8ff18988398e7fdd48265e42.yml
openapi_spec_hash: a11c27df8b3dc31b1e2fd6ab0f7c831c
config_hash: 2ceaf6cd488db626c181a1ca9460ace6
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.1.0 (2026-04-14)

Full Changelog: [v0.0.37...v0.1.0](https://github.com/whopio/whopsdk-python/compare/v0.0.37...v0.1.0)

### Features

* **api:** api update ([20538da](https://github.com/whopio/whopsdk-python/commit/20538dac0521ceefba7459719d9f06361f7bc105))
* **api:** api update ([4b47351](https://github.com/whopio/whopsdk-python/commit/4b473516d13634548a42f06b421747d03c54192f))


### Bug Fixes

* ensure file data are only sent as 1 parameter ([0621a7d](https://github.com/whopio/whopsdk-python/commit/0621a7d6524577f1fd7d17a63ea5f1cc2d34bb3a))

## 0.0.37 (2026-04-10)

Full Changelog: [v0.0.36...v0.0.37](https://github.com/whopio/whopsdk-python/compare/v0.0.36...v0.0.37)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "whop-sdk"
version = "0.0.37"
version = "0.1.0"
description = "The official Python library for the Whop API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
5 changes: 3 additions & 2 deletions src/whop_sdk/_utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def _extract_items(
index += 1
if is_dict(obj):
try:
# We are at the last entry in the path so we must remove the field
if (len(path)) == index:
# Remove the field if there are no more dict keys in the path,
# only "<array>" traversal markers or end.
if all(p == "<array>" for p in path[index:]):
item = obj.pop(key)
else:
item = obj[key]
Expand Down
2 changes: 1 addition & 1 deletion src/whop_sdk/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "whop_sdk"
__version__ = "0.0.37" # x-release-please-version
__version__ = "0.1.0" # x-release-please-version
28 changes: 28 additions & 0 deletions src/whop_sdk/resources/checkout_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def create(
*,
plan: checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanPlan,
affiliate_code: Optional[str] | Omit = omit,
allow_promo_codes: Optional[bool] | Omit = omit,
checkout_styling: Optional[
checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanCheckoutStyling
]
Expand Down Expand Up @@ -91,6 +92,9 @@ def create(

affiliate_code: An affiliate tracking code to attribute the checkout to a specific affiliate.

allow_promo_codes: Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.

checkout_styling: Checkout styling overrides for this session. Overrides plan and company
defaults.

Expand Down Expand Up @@ -121,6 +125,7 @@ def create(
*,
plan_id: str,
affiliate_code: Optional[str] | Omit = omit,
allow_promo_codes: Optional[bool] | Omit = omit,
checkout_styling: Optional[
checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanIDCheckoutStyling
]
Expand Down Expand Up @@ -158,6 +163,9 @@ def create(

affiliate_code: An affiliate tracking code to attribute the checkout to a specific affiliate.

allow_promo_codes: Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.

checkout_styling: Checkout styling overrides for this session. Overrides plan and company
defaults.

Expand Down Expand Up @@ -188,6 +196,7 @@ def create(
*,
company_id: str,
mode: Literal["setup"],
allow_promo_codes: Optional[bool] | Omit = omit,
checkout_styling: Optional[
checkout_configuration_create_params.CreateCheckoutSessionInputModeSetupCheckoutStyling
]
Expand Down Expand Up @@ -222,6 +231,9 @@ def create(
company_id: The unique identifier of the company to create the checkout configuration for.
Only required in setup mode.

allow_promo_codes: Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.

checkout_styling: Checkout styling overrides for this session. Overrides plan and company
defaults.

Expand Down Expand Up @@ -252,6 +264,7 @@ def create(
*,
plan: checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanPlan | Omit = omit,
affiliate_code: Optional[str] | Omit = omit,
allow_promo_codes: Optional[bool] | Omit = omit,
checkout_styling: Optional[
checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanCheckoutStyling
]
Expand Down Expand Up @@ -286,6 +299,7 @@ def create(
{
"plan": plan,
"affiliate_code": affiliate_code,
"allow_promo_codes": allow_promo_codes,
"checkout_styling": checkout_styling,
"currency": currency,
"metadata": metadata,
Expand Down Expand Up @@ -449,6 +463,7 @@ async def create(
*,
plan: checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanPlan,
affiliate_code: Optional[str] | Omit = omit,
allow_promo_codes: Optional[bool] | Omit = omit,
checkout_styling: Optional[
checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanCheckoutStyling
]
Expand Down Expand Up @@ -485,6 +500,9 @@ async def create(

affiliate_code: An affiliate tracking code to attribute the checkout to a specific affiliate.

allow_promo_codes: Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.

checkout_styling: Checkout styling overrides for this session. Overrides plan and company
defaults.

Expand Down Expand Up @@ -515,6 +533,7 @@ async def create(
*,
plan_id: str,
affiliate_code: Optional[str] | Omit = omit,
allow_promo_codes: Optional[bool] | Omit = omit,
checkout_styling: Optional[
checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanIDCheckoutStyling
]
Expand Down Expand Up @@ -552,6 +571,9 @@ async def create(

affiliate_code: An affiliate tracking code to attribute the checkout to a specific affiliate.

allow_promo_codes: Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.

checkout_styling: Checkout styling overrides for this session. Overrides plan and company
defaults.

Expand Down Expand Up @@ -582,6 +604,7 @@ async def create(
*,
company_id: str,
mode: Literal["setup"],
allow_promo_codes: Optional[bool] | Omit = omit,
checkout_styling: Optional[
checkout_configuration_create_params.CreateCheckoutSessionInputModeSetupCheckoutStyling
]
Expand Down Expand Up @@ -616,6 +639,9 @@ async def create(
company_id: The unique identifier of the company to create the checkout configuration for.
Only required in setup mode.

allow_promo_codes: Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.

checkout_styling: Checkout styling overrides for this session. Overrides plan and company
defaults.

Expand Down Expand Up @@ -646,6 +672,7 @@ async def create(
*,
plan: checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanPlan | Omit = omit,
affiliate_code: Optional[str] | Omit = omit,
allow_promo_codes: Optional[bool] | Omit = omit,
checkout_styling: Optional[
checkout_configuration_create_params.CreateCheckoutSessionInputModePaymentWithPlanCheckoutStyling
]
Expand Down Expand Up @@ -680,6 +707,7 @@ async def create(
{
"plan": plan,
"affiliate_code": affiliate_code,
"allow_promo_codes": allow_promo_codes,
"checkout_styling": checkout_styling,
"currency": currency,
"metadata": metadata,
Expand Down
18 changes: 18 additions & 0 deletions src/whop_sdk/types/checkout_configuration_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ class CreateCheckoutSessionInputModePaymentWithPlan(TypedDict, total=False):
affiliate_code: Optional[str]
"""An affiliate tracking code to attribute the checkout to a specific affiliate."""

allow_promo_codes: Optional[bool]
"""
Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.
"""

checkout_styling: Optional[CreateCheckoutSessionInputModePaymentWithPlanCheckoutStyling]
"""Checkout styling overrides for this session.

Expand Down Expand Up @@ -340,6 +346,12 @@ class CreateCheckoutSessionInputModePaymentWithPlanID(TypedDict, total=False):
affiliate_code: Optional[str]
"""An affiliate tracking code to attribute the checkout to a specific affiliate."""

allow_promo_codes: Optional[bool]
"""
Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.
"""

checkout_styling: Optional[CreateCheckoutSessionInputModePaymentWithPlanIDCheckoutStyling]
"""Checkout styling overrides for this session.

Expand Down Expand Up @@ -421,6 +433,12 @@ class CreateCheckoutSessionInputModeSetup(TypedDict, total=False):

mode: Required[Literal["setup"]]

allow_promo_codes: Optional[bool]
"""
Whether the checkout should show the promo code input field and accept promo
codes. Defaults to true.
"""

checkout_styling: Optional[CreateCheckoutSessionInputModeSetupCheckoutStyling]
"""Checkout styling overrides for this session.

Expand Down
6 changes: 6 additions & 0 deletions src/whop_sdk/types/checkout_configuration_list_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ class CheckoutConfigurationListResponse(BaseModel):
affiliate_code: Optional[str] = None
"""The affiliate code to use for the checkout configuration"""

allow_promo_codes: bool
"""Whether the checkout configuration allows promo codes.

When false, the promo code input is hidden and promo codes are rejected.
"""

company_id: str
"""The ID of the company to use for the checkout configuration"""

Expand Down
6 changes: 6 additions & 0 deletions src/whop_sdk/types/shared/checkout_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ class CheckoutConfiguration(BaseModel):
affiliate_code: Optional[str] = None
"""The affiliate code to use for the checkout configuration"""

allow_promo_codes: bool
"""Whether the checkout configuration allows promo codes.

When false, the promo code input is hidden and promo codes are rejected.
"""

company_id: str
"""The ID of the company to use for the checkout configuration"""

Expand Down
1 change: 1 addition & 0 deletions src/whop_sdk/types/verification_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
"expired",
"abandoned",
"review",
"action_required",
]
6 changes: 6 additions & 0 deletions tests/api_resources/test_checkout_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def test_method_create_with_all_params_overload_1(self, client: Whop) -> None:
"visibility": "visible",
},
affiliate_code="affiliate_code",
allow_promo_codes=True,
checkout_styling={
"border_style": "rounded",
"button_color": "button_color",
Expand Down Expand Up @@ -153,6 +154,7 @@ def test_method_create_with_all_params_overload_2(self, client: Whop) -> None:
checkout_configuration = client.checkout_configurations.create(
plan_id="plan_xxxxxxxxxxxxx",
affiliate_code="affiliate_code",
allow_promo_codes=True,
checkout_styling={
"border_style": "rounded",
"button_color": "button_color",
Expand Down Expand Up @@ -212,6 +214,7 @@ def test_method_create_with_all_params_overload_3(self, client: Whop) -> None:
checkout_configuration = client.checkout_configurations.create(
company_id="biz_xxxxxxxxxxxxxx",
mode="setup",
allow_promo_codes=True,
checkout_styling={
"border_style": "rounded",
"button_color": "button_color",
Expand Down Expand Up @@ -430,6 +433,7 @@ async def test_method_create_with_all_params_overload_1(self, async_client: Asyn
"visibility": "visible",
},
affiliate_code="affiliate_code",
allow_promo_codes=True,
checkout_styling={
"border_style": "rounded",
"button_color": "button_color",
Expand Down Expand Up @@ -494,6 +498,7 @@ async def test_method_create_with_all_params_overload_2(self, async_client: Asyn
checkout_configuration = await async_client.checkout_configurations.create(
plan_id="plan_xxxxxxxxxxxxx",
affiliate_code="affiliate_code",
allow_promo_codes=True,
checkout_styling={
"border_style": "rounded",
"button_color": "button_color",
Expand Down Expand Up @@ -553,6 +558,7 @@ async def test_method_create_with_all_params_overload_3(self, async_client: Asyn
checkout_configuration = await async_client.checkout_configurations.create(
company_id="biz_xxxxxxxxxxxxxx",
mode="setup",
allow_promo_codes=True,
checkout_styling={
"border_style": "rounded",
"button_color": "button_color",
Expand Down
9 changes: 9 additions & 0 deletions tests/test_extract_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ def test_multiple_files() -> None:
assert query == {"documents": [{}, {}]}


def test_top_level_file_array() -> None:
query = {"files": [b"file one", b"file two"], "title": "hello"}
assert extract_files(query, paths=[["files", "<array>"]]) == [
("files[]", b"file one"),
("files[]", b"file two"),
]
assert query == {"title": "hello"}


@pytest.mark.parametrize(
"query,paths,expected",
[
Expand Down