Skip to content
Merged
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,17 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Read OpenAPI version
id: openapi
shell: bash
run: echo "version=$(< OPENAPI_VERSION)" >> "$GITHUB_OUTPUT"
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python_version }}
- uses: stripe/openapi/actions/stripe-mock@master
with:
openapi_version: ${{ steps.openapi.outputs.version }}

- name: "run tests"
run: just test
Expand Down
80 changes: 80 additions & 0 deletions .hark/changes/2026-09-30_stripe-openapi_217ec12b.change.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2d13381d5dfd98ca6daaddeefc23711d41c7170a
adad04916772f880317eac10d8c026b401863f1d
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2516
v2526
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ reportUnnecessaryComparison = true
reportUnnecessaryContains = true
reportUnnecessaryIsInstance = true
reportPrivateImportUsage = true
reportUnnecessaryTypeIgnoreComment = false
reportUnnecessaryTypeIgnoreComment = true

[tool.mypy]
follow_imports = "silent"
Expand Down
20 changes: 16 additions & 4 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ def add_beta_version(
tax as tax,
terminal as terminal,
test_helpers as test_helpers,
three_d_secure as three_d_secure,
treasury as treasury,
v2 as v2,
)
Expand Down Expand Up @@ -354,7 +355,6 @@ def add_beta_version(
CannotProceedError as CannotProceedError,
CardError as CardError,
ControlledByAlternateResourceError as ControlledByAlternateResourceError,
ControlledByDashboardError as ControlledByDashboardError,
FeatureNotEnabledError as FeatureNotEnabledError,
FinancialAccountNotOpenError as FinancialAccountNotOpenError,
FxQuoteExpiredError as FxQuoteExpiredError,
Expand All @@ -364,6 +364,7 @@ def add_beta_version(
InvalidPaymentMethodError as InvalidPaymentMethodError,
InvalidPayoutMethodError as InvalidPayoutMethodError,
InvalidRequestError as InvalidRequestError,
InvalidVaultedCredentialError as InvalidVaultedCredentialError,
MerchantNotGatedError as MerchantNotGatedError,
NonZeroBalanceError as NonZeroBalanceError,
NotCancelableError as NotCancelableError,
Expand All @@ -376,6 +377,9 @@ def add_beta_version(
StripeError as StripeError,
StripeErrorWithParamCode as StripeErrorWithParamCode,
TemporarySessionExpiredError as TemporarySessionExpiredError,
VerificationAttemptFailedError as VerificationAttemptFailedError,
VerificationExpiredError as VerificationExpiredError,
VerificationNotInitiatedError as VerificationNotInitiatedError,
)
from stripe._error_object import (
ErrorObject as ErrorObject,
Expand Down Expand Up @@ -585,7 +589,6 @@ def add_beta_version(
from stripe._reserve_transaction import (
ReserveTransaction as ReserveTransaction,
)
from stripe._reversal import Reversal as Reversal
from stripe._review import Review as Review
from stripe._review_service import ReviewService as ReviewService
from stripe._risk_signals import RiskSignals as RiskSignals
Expand Down Expand Up @@ -667,11 +670,15 @@ def add_beta_version(
from stripe._test_helpers_service import (
TestHelpersService as TestHelpersService,
)
from stripe._three_d_secure_service import (
ThreeDSecureService as ThreeDSecureService,
)
from stripe._token import Token as Token
from stripe._token_service import TokenService as TokenService
from stripe._topup import Topup as Topup
from stripe._topup_service import TopupService as TopupService
from stripe._transfer import Transfer as Transfer
from stripe._transfer_reversal import TransferReversal as TransferReversal
from stripe._transfer_reversal_service import (
TransferReversalService as TransferReversalService,
)
Expand Down Expand Up @@ -725,6 +732,7 @@ def add_beta_version(
"tax": ("stripe.tax", True),
"terminal": ("stripe.terminal", True),
"test_helpers": ("stripe.test_helpers", True),
"three_d_secure": ("stripe.three_d_secure", True),
"treasury": ("stripe.treasury", True),
"v2": ("stripe.v2", True),
"Account": ("stripe._account", False),
Expand Down Expand Up @@ -863,7 +871,6 @@ def add_beta_version(
"CannotProceedError": ("stripe._error", False),
"CardError": ("stripe._error", False),
"ControlledByAlternateResourceError": ("stripe._error", False),
"ControlledByDashboardError": ("stripe._error", False),
"FeatureNotEnabledError": ("stripe._error", False),
"FinancialAccountNotOpenError": ("stripe._error", False),
"FxQuoteExpiredError": ("stripe._error", False),
Expand All @@ -873,6 +880,7 @@ def add_beta_version(
"InvalidPaymentMethodError": ("stripe._error", False),
"InvalidPayoutMethodError": ("stripe._error", False),
"InvalidRequestError": ("stripe._error", False),
"InvalidVaultedCredentialError": ("stripe._error", False),
"MerchantNotGatedError": ("stripe._error", False),
"NonZeroBalanceError": ("stripe._error", False),
"NotCancelableError": ("stripe._error", False),
Expand All @@ -885,6 +893,9 @@ def add_beta_version(
"StripeError": ("stripe._error", False),
"StripeErrorWithParamCode": ("stripe._error", False),
"TemporarySessionExpiredError": ("stripe._error", False),
"VerificationAttemptFailedError": ("stripe._error", False),
"VerificationExpiredError": ("stripe._error", False),
"VerificationNotInitiatedError": ("stripe._error", False),
"ErrorObject": ("stripe._error_object", False),
"OAuthErrorObject": ("stripe._error_object", False),
"Event": ("stripe._event", False),
Expand Down Expand Up @@ -1064,7 +1075,6 @@ def add_beta_version(
"RequestorOptions": ("stripe._requestor_options", False),
"ReserveService": ("stripe._reserve_service", False),
"ReserveTransaction": ("stripe._reserve_transaction", False),
"Reversal": ("stripe._reversal", False),
"Review": ("stripe._review", False),
"ReviewService": ("stripe._review_service", False),
"RiskSignals": ("stripe._risk_signals", False),
Expand Down Expand Up @@ -1116,11 +1126,13 @@ def add_beta_version(
"TerminalService": ("stripe._terminal_service", False),
"APIResourceTestHelpers": ("stripe._test_helpers", False),
"TestHelpersService": ("stripe._test_helpers_service", False),
"ThreeDSecureService": ("stripe._three_d_secure_service", False),
"Token": ("stripe._token", False),
"TokenService": ("stripe._token_service", False),
"Topup": ("stripe._topup", False),
"TopupService": ("stripe._topup_service", False),
"Transfer": ("stripe._transfer", False),
"TransferReversal": ("stripe._transfer_reversal", False),
"TransferReversalService": ("stripe._transfer_reversal_service", False),
"TransferService": ("stripe._transfer_service", False),
"TransitBalance": ("stripe._transit_balance", False),
Expand Down
36 changes: 16 additions & 20 deletions stripe/_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@ class Details(StripeObject):
]
]
"""
If the account is disabled, this string describes why the account can't create charges or receive payouts. Can be `rejected.fraud`, `rejected.terms_of_service`, `rejected.listed`, `rejected.other`, `fields_needed`, `listed`, `under_review`, or `other`.
This is typed as an enum for consistency with `requirements.disabled_reason`.
"""
errors: Optional[List[Error]]
"""
Expand Down Expand Up @@ -1498,7 +1498,7 @@ class Details(StripeObject):
]
]
"""
If the account is disabled, this string describes why the account can't create charges or receive payouts. Can be `rejected.fraud`, `rejected.terms_of_service`, `rejected.listed`, `rejected.other`, `fields_needed`, `listed`, `under_review`, or `other`.
If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://docs.stripe.com/connect/handling-api-verification).
"""
errors: Optional[List[Error]]
"""
Expand Down Expand Up @@ -2034,7 +2034,7 @@ async def create_async(

@classmethod
def _cls_delete(
cls, sid: str, **params: Unpack["AccountDeleteParams"]
cls, sid: str, /, **params: Unpack["AccountDeleteParams"]
) -> "Account":
"""
With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage.
Expand All @@ -2057,7 +2057,9 @@ def _cls_delete(

@overload
@staticmethod
def delete(sid: str, **params: Unpack["AccountDeleteParams"]) -> "Account":
def delete(
sid: str, /, **params: Unpack["AccountDeleteParams"]
) -> "Account":
"""
With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage.

Expand All @@ -2083,9 +2085,7 @@ def delete(self, **params: Unpack["AccountDeleteParams"]) -> "Account":
...

@class_method_variant("_cls_delete")
def delete( # pyright: ignore[reportGeneralTypeIssues]
self, **params: Unpack["AccountDeleteParams"]
) -> "Account":
def delete(self, **params: Unpack["AccountDeleteParams"]) -> "Account":
"""
With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage.

Expand All @@ -2103,7 +2103,7 @@ def delete( # pyright: ignore[reportGeneralTypeIssues]

@classmethod
async def _cls_delete_async(
cls, sid: str, **params: Unpack["AccountDeleteParams"]
cls, sid: str, /, **params: Unpack["AccountDeleteParams"]
) -> "Account":
"""
With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage.
Expand All @@ -2127,7 +2127,7 @@ async def _cls_delete_async(
@overload
@staticmethod
async def delete_async(
sid: str, **params: Unpack["AccountDeleteParams"]
sid: str, /, **params: Unpack["AccountDeleteParams"]
) -> "Account":
"""
With [Connect](https://docs.stripe.com/connect), you can delete accounts you manage.
Expand Down Expand Up @@ -2156,7 +2156,7 @@ async def delete_async(
...

@class_method_variant("_cls_delete_async")
async def delete_async( # pyright: ignore[reportGeneralTypeIssues]
async def delete_async(
self, **params: Unpack["AccountDeleteParams"]
) -> "Account":
"""
Expand Down Expand Up @@ -2252,7 +2252,7 @@ def persons(
...

@class_method_variant("_cls_persons")
def persons( # pyright: ignore[reportGeneralTypeIssues]
def persons(
self, **params: Unpack["AccountPersonsParams"]
) -> ListObject["Person"]:
"""
Expand Down Expand Up @@ -2307,7 +2307,7 @@ async def persons_async(
...

@class_method_variant("_cls_persons_async")
async def persons_async( # pyright: ignore[reportGeneralTypeIssues]
async def persons_async(
self, **params: Unpack["AccountPersonsParams"]
) -> ListObject["Person"]:
"""
Expand Down Expand Up @@ -2366,9 +2366,7 @@ def reject(self, **params: Unpack["AccountRejectParams"]) -> "Account":
...

@class_method_variant("_cls_reject")
def reject( # pyright: ignore[reportGeneralTypeIssues]
self, **params: Unpack["AccountRejectParams"]
) -> "Account":
def reject(self, **params: Unpack["AccountRejectParams"]) -> "Account":
"""
With [Connect](https://docs.stripe.com/connect), you can reject accounts that you have flagged as suspicious.

Expand Down Expand Up @@ -2429,7 +2427,7 @@ async def reject_async(
...

@class_method_variant("_cls_reject_async")
async def reject_async( # pyright: ignore[reportGeneralTypeIssues]
async def reject_async(
self, **params: Unpack["AccountRejectParams"]
) -> "Account":
"""
Expand Down Expand Up @@ -2496,9 +2494,7 @@ def unreject(self, **params: Unpack["AccountUnrejectParams"]) -> "Account":
...

@class_method_variant("_cls_unreject")
def unreject( # pyright: ignore[reportGeneralTypeIssues]
self, **params: Unpack["AccountUnrejectParams"]
) -> "Account":
def unreject(self, **params: Unpack["AccountUnrejectParams"]) -> "Account":
"""
With Connect, you can unreject accounts that you have previously rejected.

Expand Down Expand Up @@ -2567,7 +2563,7 @@ async def unreject_async(
...

@class_method_variant("_cls_unreject_async")
async def unreject_async( # pyright: ignore[reportGeneralTypeIssues]
async def unreject_async(
self, **params: Unpack["AccountUnrejectParams"]
) -> "Account":
"""
Expand Down
4 changes: 2 additions & 2 deletions stripe/_account_notice.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async def list_async(

@classmethod
def modify(
cls, id: str, **params: Unpack["AccountNoticeModifyParams"]
cls, id: str, /, **params: Unpack["AccountNoticeModifyParams"]
) -> "AccountNotice":
"""
Updates an AccountNotice object.
Expand All @@ -177,7 +177,7 @@ def modify(

@classmethod
async def modify_async(
cls, id: str, **params: Unpack["AccountNoticeModifyParams"]
cls, id: str, /, **params: Unpack["AccountNoticeModifyParams"]
) -> "AccountNotice":
"""
Updates an AccountNotice object.
Expand Down
22 changes: 20 additions & 2 deletions stripe/_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,6 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data):
)
elif type == "controlled_by_alternate_resource":
return error.ControlledByAlternateResourceError(**error_args)
elif type == "controlled_by_dashboard":
return error.ControlledByDashboardError(**error_args)
elif type == "feature_not_enabled":
return error.FeatureNotEnabledError(**error_args)
elif type == "financial_account_not_open":
Expand All @@ -449,6 +447,11 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data):
)
elif type == "invalid_payout_method":
return error.InvalidPayoutMethodError(**error_args)
elif type == "invalid_vaulted_credential":
return error.InvalidVaultedCredentialError(
**error_args,
invalid_param=error_data.get("invalid_param"),
)
elif type == "merchant_not_gated":
return error.MerchantNotGatedError(**error_args)
elif type == "non_zero_balance":
Expand All @@ -465,6 +468,21 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data):
return error.ServiceUnavailableError(**error_args)
elif type == "temporary_session_expired":
return error.TemporarySessionExpiredError(**error_args)
elif type == "verification_attempt_failed":
return error.VerificationAttemptFailedError(
**error_args,
verification_status=error_data.get("verification_status"),
)
elif type == "verification_expired":
return error.VerificationExpiredError(
**error_args,
verification_status=error_data.get("verification_status"),
)
elif type == "verification_not_initiated":
return error.VerificationNotInitiatedError(
**error_args,
verification_status=error_data.get("verification_status"),
)
# switchCases: The end of the section generated from our OpenAPI spec

return self.specific_v1_api_error(
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-09-23.preview"
CURRENT = "2026-09-30.preview"
CURRENT_MAJOR = ""
Loading
Loading