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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

## Conventions

- Uses `requests` library by default for sync HTTP, `httpx` for async
- Uses `requests` library by default for sync HTTP, `httpx2` (falling back to `httpx`) for async
- Type hints throughout
- Virtual env managed in `.venv/`; `just` recipes handle setup automatically
- Work is not complete until `just test`, `just lint` and `just typecheck` complete successfully.
Expand Down
30 changes: 30 additions & 0 deletions .hark/changes/2026-11-19_stripe-openapi_031ed7f8.change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: Update generated code
pr_url: https://github.com/stripe/stripe-python/pull/1964
semver_level: major
is_stripe_api_change: true
---

* ⚠️ Remove support for resource `v2.billing.Cadence`
* Add support for `create` and `refill` test helper methods on resource `capital.FinancingOffer`
* ⚠️ Remove support for `cancel`, `create`, `list`, `modify`, and `retrieve` methods on resource `v2.billing.Cadence`
* Add support for `export_tax_transactions`, `product_tax_code_selector`, and `tax_threshold_monitoring` on `AccountSession.Component`
* Add support for `custom` on `CouponCreateParams` and `Coupon`
* Add support for `type` on `CouponCreateParams` and `CustomerCreateCustomerBalanceTransactionParams`
* Add support for new value `custom` on enum `Coupon.type`
* Add support for `applied_to_invoice` on `CustomerCreateCustomerBalanceTransactionParams`
* Add support for `customer_balance` on `Invoice` and `QuotePreviewInvoice`
* ⚠️ Change type of `PaymentIntent.NextAction.VerifyWithMicrodeposit.arrival_date` and `SetupIntent.NextAction.VerifyWithMicrodeposit.arrival_date` from `DateTime` to `nullable(DateTime)`
* Add support for `connect`, `data_export`, `event_destination`, `radar`, and `user_access` on `V2.Iam.ActivityLog.Detail`
* Add support for new values `app`, `connect`, `data_export`, `event_destination`, `radar`, and `user_access` on enum `V2.Iam.ActivityLog.Detail.type`
* Add support for new values `apps.install`, `v2.core.event_destination`, and `webhook_endpoint` on enum `V2.Iam.ActivityLog.RelatedObject.type`
* Add support for new values `app_installed`, `app_uninstalled`, `application_authorized`, `application_created`, `application_deauthorized`, `connect_express_branding_updated`, `connect_oauth_disabled`, `connect_oauth_enabled`, `connect_settings_updated`, `connect_site_link_updated`, `data_export_requested`, `event_destination_added`, `event_destination_removed`, `event_destination_updated`, `payout_schedule_updated`, `radar_adaptive_3ds_disabled`, `radar_dynamic_risk_thresholds_disabled`, `radar_early_fraud_warning_disabled`, `radar_for_setup_intents_disabled`, `radar_fraud_dispute_protection_disabled`, `radar_rule_added`, `radar_rule_disabled`, `radar_rule_enabled`, `radar_rule_removed`, `radar_rule_updated`, and `user_access_started` on enum `V2.Iam.ActivityLog.type`
* Add support for `apple_pay` on `V2.MoneyManagement.PayoutMethod` and `v2.money_management.OutboundSetupIntentCreateParamsPayoutMethodDatum`
* Add support for new value `apple_pay` on enums `V2.MoneyManagement.PayoutMethod.type`, `v2.money_management.OutboundSetupIntentCreateParamsPayoutMethodDatum.type`, and `v2.money_management.OutboundSetupIntentModifyParamsPayoutMethodDatum.type`
* Add support for `network` and `originating_bank_account` on `V2.MoneyManagement.ReceivedDebit.BankTransfer`
* Add support for `created` on `v2.money_management.ReceivedDebitListParams`
* Add support for `logs_from` on `v2.iam.ActivityLogListParams`
* Add support for new values `app`, `connect`, `data_export`, `event_destination`, `radar`, and `user_access` on enum `v2.iam.ActivityLogListParams.action_groups`
* Add support for new values `app_installed`, `app_uninstalled`, `application_authorized`, `application_created`, `application_deauthorized`, `connect_express_branding_updated`, `connect_oauth_disabled`, `connect_oauth_enabled`, `connect_settings_updated`, `connect_site_link_updated`, `data_export_requested`, `event_destination_added`, `event_destination_removed`, `event_destination_updated`, `payout_schedule_updated`, `radar_adaptive_3ds_disabled`, `radar_dynamic_risk_thresholds_disabled`, `radar_early_fraud_warning_disabled`, `radar_for_setup_intents_disabled`, `radar_fraud_dispute_protection_disabled`, `radar_rule_added`, `radar_rule_disabled`, `radar_rule_enabled`, `radar_rule_removed`, `radar_rule_updated`, and `user_access_started` on enum `v2.iam.ActivityLogListParams.actions`
* Add support for `severity` on `EventsV2CoreHealthEventGenerationFailureResolvedEvent`
* Add support for error code `inactive_api_operation_confirmation_required` on `QuotePreviewInvoice.LastFinalizationError`
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
65c49b0893d71e8cfe272b2d38cd3307ee1833f2
f3581f76eec818aa658fd9635eaf0107d13e3441
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2596
v2602
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,12 @@ async for c in await stripe.Customer.list_async().auto_paging_iter():
There is no `.save_async` as `.save` is [deprecated since stripe-python v5](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v5#deprecated). Please migrate to `.modify_async`.

The default HTTP client uses `requests` for making synchronous requests but
`httpx` for making async requests. If you're migrating to async, we recommend
you to explicitly initialize your own http client and pass it to StripeClient
or set it as the global default.
`httpx2` for making async requests, falling back to `httpx` if `httpx2` isn't
installed (and to `aiohttp` if neither is). We recommend `pip install httpx2`
for async use, since `httpx` is no longer actively maintained. `httpx` support
is deprecated and will be removed in the next major version of stripe-python.
If you're migrating to async, we recommend you to explicitly initialize your own
http client and pass it to StripeClient or set it as the global default.

If you don't already have a dependency on an async-compatible HTTP library, `pip install stripe[async]` will install one for you (new in `v13.0.1`).

Expand All @@ -382,7 +385,7 @@ If you don't already have a dependency on an async-compatible HTTP library, `pip
# make sure you don't unintentionally make a synchronous request.
my_http_client = stripe.HTTPXClient()

# If you want to use httpx to make sync requests, you can disable this
# If you want to use httpx2 to make sync requests, you can disable this
# behavior.
my_http_client = stripe.HTTPXClient(allow_sync_methods=True)

Expand Down
19 changes: 8 additions & 11 deletions deps/test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
# packages needed to run unit tests (including extra supported http libraries)
# version requirements: all supported versions (currently 3.6-3.12)
# version requirements: all supported versions (currently 3.9-3.14)

# This is the last version of httpx compatible with Python 3.6
httpx == 0.22.0; python_version == "3.6"
httpx >= 0.24.1; python_version == "3.7"
httpx >= 0.27.0; python_version >= "3.8"
aiohttp == 3.8.6; python_version <= "3.7"
aiohttp == 3.10.11; python_version == "3.8"
aiohttp == 3.12.15; python_version >= "3.9"
anyio[trio] == 3.6.2; python_version < "3.13"
anyio[trio] == 4.11.0; python_version >= "3.13"
httpx2 >= 2.0.0
# fallback when httpx2 isn't installed
# TODO: (DEVSDK-3427) remove httpx in the next major version
httpx >= 0.27.0
aiohttp == 3.12.15
# httpx2 requires anyio >= 4.10 since 2.9.0
anyio[trio] == 4.10.0

pytest-mock >= 2.0.0
mock >= 4.0; python_version < "3.8"
pytest-xdist >= 1.31.0
pytest >= 6.0.0,<9.0.0
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
39 changes: 39 additions & 0 deletions stripe/_account_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,17 @@ class Features(StripeObject):
features: Features
_inner_class_types = {"features": Features}

class ExportTaxTransactions(StripeObject):
class Features(StripeObject):
pass

enabled: bool
"""
Whether the embedded component is enabled.
"""
features: Features
_inner_class_types = {"features": Features}

class FinancialAccount(StripeObject):
class Features(StripeObject):
disable_stripe_user_authentication: bool
Expand Down Expand Up @@ -475,6 +486,17 @@ class Features(StripeObject):
features: Features
_inner_class_types = {"features": Features}

class ProductTaxCodeSelector(StripeObject):
class Features(StripeObject):
pass

enabled: bool
"""
Whether the embedded component is enabled.
"""
features: Features
_inner_class_types = {"features": Features}

class ReportingChart(StripeObject):
class Features(StripeObject):
pass
Expand Down Expand Up @@ -508,6 +530,17 @@ class Features(StripeObject):
features: Features
_inner_class_types = {"features": Features}

class TaxThresholdMonitoring(StripeObject):
class Features(StripeObject):
pass

enabled: bool
"""
Whether the embedded component is enabled.
"""
features: Features
_inner_class_types = {"features": Features}

class TerminalHardwareOrders(StripeObject):
class Features(StripeObject):
pass
Expand Down Expand Up @@ -539,6 +572,7 @@ class Features(StripeObject):
capital_financing_promotion: Optional[CapitalFinancingPromotion]
disputes_list: DisputesList
documents: Documents
export_tax_transactions: Optional[ExportTaxTransactions]
financial_account: FinancialAccount
financial_account_transactions: FinancialAccountTransactions
instant_payouts_promotion: InstantPayoutsPromotion
Expand All @@ -553,9 +587,11 @@ class Features(StripeObject):
payout_reconciliation_report: PayoutReconciliationReport
payouts: Payouts
payouts_list: PayoutsList
product_tax_code_selector: Optional[ProductTaxCodeSelector]
reporting_chart: ReportingChart
tax_registrations: TaxRegistrations
tax_settings: TaxSettings
tax_threshold_monitoring: Optional[TaxThresholdMonitoring]
terminal_hardware_orders: TerminalHardwareOrders
terminal_hardware_shop: TerminalHardwareShop
_inner_class_types = {
Expand All @@ -568,6 +604,7 @@ class Features(StripeObject):
"capital_financing_promotion": CapitalFinancingPromotion,
"disputes_list": DisputesList,
"documents": Documents,
"export_tax_transactions": ExportTaxTransactions,
"financial_account": FinancialAccount,
"financial_account_transactions": FinancialAccountTransactions,
"instant_payouts_promotion": InstantPayoutsPromotion,
Expand All @@ -582,9 +619,11 @@ class Features(StripeObject):
"payout_reconciliation_report": PayoutReconciliationReport,
"payouts": Payouts,
"payouts_list": PayoutsList,
"product_tax_code_selector": ProductTaxCodeSelector,
"reporting_chart": ReportingChart,
"tax_registrations": TaxRegistrations,
"tax_settings": TaxSettings,
"tax_threshold_monitoring": TaxThresholdMonitoring,
"terminal_hardware_orders": TerminalHardwareOrders,
"terminal_hardware_shop": TerminalHardwareShop,
}
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-10-28.preview"
CURRENT = "2026-11-18.preview"
CURRENT_MAJOR = ""
2 changes: 1 addition & 1 deletion stripe/_balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,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, 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`.
The exchange rate used for this transaction, if applicable. Multiplying the source `amount` by the `exchange_rate` gives the destination `amount`, both in their currencies' smallest units. For example, `1000` EUR cents converts to `1234` USD cents at `1.234`. For a zero-decimal currency such as JPY, `1000` JPY converts to `640` USD cents (6.40 USD) at `0.64`, equivalent to `0.0064` USD per JPY. For JPY to USD, the API multiplier is 100 times the whole-unit rate because JPY amounts use yen and USD amounts use cents.
"""
fee: int
"""
Expand Down
Loading