Skip to content
Merged
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6012b623b1c09ad54d466947da04511a042ee45a
44014016ec56efb57a8cf6d0ee0771c2e6b4eebe
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2324
v2349
349 changes: 285 additions & 64 deletions stripe/_account.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions stripe/_account_person_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def delete(
options: Optional["RequestOptions"] = None,
) -> "Person":
"""
Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file.
Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the representative. If your integration is using the executive parameter, you cannot delete the only verified executive on file.
"""
return cast(
"Person",
Expand All @@ -59,7 +59,7 @@ async def delete_async(
options: Optional["RequestOptions"] = None,
) -> "Person":
"""
Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file.
Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the representative. If your integration is using the executive parameter, you cannot delete the only verified executive on file.
"""
return cast(
"Person",
Expand Down
61 changes: 57 additions & 4 deletions stripe/_account_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
AccountRetrieveCurrentParams,
)
from stripe.params._account_retrieve_params import AccountRetrieveParams
from stripe.params._account_unreject_params import AccountUnrejectParams
from stripe.params._account_update_params import AccountUpdateParams

_subservices = {
Expand Down Expand Up @@ -309,7 +310,7 @@ def create(
With [Connect](https://docs.stripe.com/docs/connect), you can create Stripe accounts for your users.
To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).

If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/docs/connect/best-practices#onboarding) when
If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/connect/marketplace/tasks/create#prefill-account-information) when
creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
You can prefill any information on the account.
"""
Expand All @@ -333,7 +334,7 @@ async def create_async(
With [Connect](https://docs.stripe.com/docs/connect), you can create Stripe accounts for your users.
To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings).

If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/docs/connect/best-practices#onboarding) when
If you've already collected information for your connected accounts, you [can prefill that information](https://docs.stripe.com/connect/marketplace/tasks/create#prefill-account-information) when
creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding.
You can prefill any information on the account.
"""
Expand All @@ -357,7 +358,7 @@ def reject(
"""
With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious.

Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected.
"""
return cast(
"Account",
Expand All @@ -381,7 +382,7 @@ async def reject_async(
"""
With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious.

Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero.
Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected.
"""
return cast(
"Account",
Expand All @@ -395,3 +396,55 @@ async def reject_async(
options=options,
),
)

def unreject(
self,
account: str,
params: Optional["AccountUnrejectParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Account":
"""
With Connect, you can unreject accounts that you have previously rejected.

Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe.

Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection.
"""
return cast(
"Account",
self._request(
"post",
"/v1/accounts/{account}/unreject".format(
account=sanitize_id(account),
),
base_address="api",
params=params,
options=options,
),
)

async def unreject_async(
self,
account: str,
params: Optional["AccountUnrejectParams"] = None,
options: Optional["RequestOptions"] = None,
) -> "Account":
"""
With Connect, you can unreject accounts that you have previously rejected.

Only accounts that were rejected by your platform can be unrejected. This API cannot be used to unreject accounts that were rejected by Stripe.

Unreject will only enable charges and/or payouts if there are no other restrictions other than those placed by a previous rejection. If you have separately paused charges and/or payouts outside of rejection, those pauses will remain in place after unrejection.
"""
return cast(
"Account",
await self._request_async(
"post",
"/v1/accounts/{account}/unreject".format(
account=sanitize_id(account),
),
base_address="api",
params=params,
options=options,
),
)
16 changes: 16 additions & 0 deletions stripe/_account_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ class Features(StripeObject):
"""
Whether sending refunds is enabled. This is `true` by default.
"""
smart_disputes_management: bool
"""
Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`.
"""

enabled: bool
"""
Expand Down Expand Up @@ -293,6 +297,10 @@ class Features(StripeObject):
"""
Whether sending refunds is enabled. This is `true` by default.
"""
smart_disputes_management: bool
"""
Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`.
"""

enabled: bool
"""
Expand All @@ -315,6 +323,10 @@ class Features(StripeObject):
"""
Whether sending refunds is enabled. This is `true` by default.
"""
smart_disputes_management: bool
"""
Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`.
"""

enabled: bool
"""
Expand All @@ -341,6 +353,10 @@ class Features(StripeObject):
"""
Whether sending refunds is enabled. This is `true` by default.
"""
smart_disputes_management: bool
"""
Whether to allow connected accounts to submit disputes using Smart Disputes. Defaults to the value of `dispute_management`.
"""

enabled: bool
"""
Expand Down
2 changes: 1 addition & 1 deletion stripe/_api_version.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
class _ApiVersion:
CURRENT = "2026-06-24.dahlia"
CURRENT = "2026-07-29.dahlia"
CURRENT_MAJOR = "dahlia"
4 changes: 2 additions & 2 deletions stripe/_application_fee.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from stripe._nested_resource_class_methods import nested_resource_class_methods
from stripe._stripe_object import StripeObject
from stripe._util import class_method_variant, sanitize_id
from typing import ClassVar, Optional, cast, overload
from typing import ClassVar, Optional, Union, cast, overload
from typing_extensions import Literal, Unpack, TYPE_CHECKING

if TYPE_CHECKING:
Expand Down Expand Up @@ -51,7 +51,7 @@ class FeeSource(StripeObject):
"""
Payout ID that created this application fee.
"""
type: Literal["charge", "payout"]
type: Union[Literal["charge", "payout"], str]
"""
Type of object that created the application fee.
"""
Expand Down
25 changes: 15 additions & 10 deletions stripe/_balance_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from stripe._singleton_api_resource import SingletonAPIResource
from stripe._stripe_object import StripeObject, UntypedStripeObject
from stripe._updateable_api_resource import UpdateableAPIResource
from typing import ClassVar, List, Optional, cast
from typing import ClassVar, List, Optional, Union, cast
from typing_extensions import Literal, Unpack, TYPE_CHECKING

if TYPE_CHECKING:
Expand Down Expand Up @@ -36,14 +36,16 @@ class AutomaticTransferRulesByCurrency(StripeObject):
"""
The maximum amount in minor units to transfer to the FinancialAccount. Only applicable when `type` is `transfer_up_to_amount`.
"""
type: Literal["transfer_all", "transfer_up_to_amount"]
type: Union[
Literal["transfer_all", "transfer_up_to_amount"], str
]
"""
The type of automatic transfer rule.
"""

class Schedule(StripeObject):
interval: Optional[
Literal["daily", "manual", "monthly", "weekly"]
Union[Literal["daily", "manual", "monthly", "weekly"], str]
]
"""
How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`.
Expand All @@ -54,12 +56,15 @@ class Schedule(StripeObject):
"""
weekly_payout_days: Optional[
List[
Literal[
"friday",
"monday",
"thursday",
"tuesday",
"wednesday",
Union[
Literal[
"friday",
"monday",
"thursday",
"tuesday",
"wednesday",
],
str,
]
]
]
Expand All @@ -85,7 +90,7 @@ class Schedule(StripeObject):
"""
The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard.
"""
status: Literal["disabled", "enabled"]
status: Union[Literal["disabled", "enabled"], str]
"""
Whether the funds in this account can be paid out.
"""
Expand Down
12 changes: 9 additions & 3 deletions stripe/_balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,14 @@ class FeeDetail(StripeObject):
"""
The date that the transaction's net funds become available in the Stripe balance.
"""
balance_type: Literal[
"issuing", "payments", "refund_and_dispute_prefunding", "risk_reserved"
balance_type: Union[
Literal[
"issuing",
"payments",
"refund_and_dispute_prefunding",
"risk_reserved",
],
str,
]
"""
The balance that this transaction impacts.
Expand All @@ -96,7 +102,7 @@ class FeeDetail(StripeObject):
"""
exchange_rate: Optional[float]
"""
If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`.
If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multiplied by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`.
"""
fee: int
"""
Expand Down
4 changes: 2 additions & 2 deletions stripe/_bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class Error(StripeObject):
"""
errors: Optional[List[Error]]
"""
Details about validation and verification failures for `due` requirements that must be resolved.
Fields that are `currently_due` and need to be collected again because validation or verification failed.
"""
past_due: Optional[List[str]]
"""
Expand Down Expand Up @@ -286,7 +286,7 @@ class Error(StripeObject):
"""
errors: Optional[List[Error]]
"""
Details about validation and verification failures for `due` requirements that must be resolved.
Fields that are `currently_due` and need to be collected again because validation or verification failed.
"""
past_due: Optional[List[str]]
"""
Expand Down
58 changes: 32 additions & 26 deletions stripe/_capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from stripe._stripe_object import StripeObject
from stripe._updateable_api_resource import UpdateableAPIResource
from stripe._util import sanitize_id
from typing import ClassVar, List, Optional
from typing import ClassVar, List, Optional, Union
from typing_extensions import Literal


Expand Down Expand Up @@ -154,25 +154,28 @@ class Error(StripeObject):
Fields that need to be resolved to keep the capability enabled. If not resolved by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash.
"""
disabled_reason: Optional[
Literal[
"other",
"paused.inactivity",
"pending.onboarding",
"pending.review",
"platform_disabled",
"platform_paused",
"rejected.inactivity",
"rejected.other",
"rejected.unsupported_business",
"requirements.fields_needed",
Union[
Literal[
"other",
"paused.inactivity",
"pending.onboarding",
"pending.review",
"platform_disabled",
"platform_paused",
"rejected.inactivity",
"rejected.other",
"rejected.unsupported_business",
"requirements.fields_needed",
],
str,
]
]
"""
This is typed as an enum for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is null because fields in `future_requirements` will never disable the account.
"""
errors: List[Error]
"""
Details about validation and verification failures for `due` requirements that must be resolved.
Fields that are `currently_due` and need to be collected again because validation or verification failed.
"""
eventually_due: List[str]
"""
Expand Down Expand Up @@ -324,25 +327,28 @@ class Error(StripeObject):
Fields that need to be resolved to keep the capability enabled. If not resolved by `current_deadline`, these fields will appear in `past_due` as well, and the capability is disabled.
"""
disabled_reason: Optional[
Literal[
"other",
"paused.inactivity",
"pending.onboarding",
"pending.review",
"platform_disabled",
"platform_paused",
"rejected.inactivity",
"rejected.other",
"rejected.unsupported_business",
"requirements.fields_needed",
Union[
Literal[
"other",
"paused.inactivity",
"pending.onboarding",
"pending.review",
"platform_disabled",
"platform_paused",
"rejected.inactivity",
"rejected.other",
"rejected.unsupported_business",
"requirements.fields_needed",
],
str,
]
]
"""
Description of why the capability is disabled. [Learn more about handling verification issues](https://docs.stripe.com/connect/handling-api-verification).
"""
errors: List[Error]
"""
Details about validation and verification failures for `due` requirements that must be resolved.
Fields that are `currently_due` and need to be collected again because validation or verification failed.
"""
eventually_due: List[str]
"""
Expand Down Expand Up @@ -380,7 +386,7 @@ class Error(StripeObject):
Time at which the capability was requested. Measured in seconds since the Unix epoch.
"""
requirements: Optional[Requirements]
status: Literal["active", "inactive", "pending", "unrequested"]
status: Union[Literal["active", "inactive", "pending", "unrequested"], str]
"""
The status of the capability.
"""
Expand Down
Loading
Loading