Skip to content

Commit e9cda9b

Browse files
Merge pull request #1664 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents 49530f0 + d24cc40 commit e9cda9b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2012
-53
lines changed

API_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
56689dcbcaa4c7ce6bf1b51a5add451972e0689c
1+
7684500f9744e3dbcd9b4b87db96f2e919c105aa

CHANGELOG.md

Lines changed: 40 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# Changelog
22

3+
## 13.2.0b1 - 2025-10-29
4+
5+
This release changes the pinned API version to `2025-10-29.preview`.
6+
7+
* [#1655](https://github.com/stripe/stripe-python/pull/1655) Update generated code for beta
8+
* Add support for `crypto_storer` on `v2.core.AccountModifyParamsIdentityAttestationTermsOfService`
9+
* [#1624](https://github.com/stripe/stripe-python/pull/1624) Update generated code for beta
10+
* Add support for `modify` method on resource `v2.money_management.FinancialAccount`
11+
* Add support for `confirm_microdeposits`, `list`, and `send_microdeposits` methods on resource `v2.core.vault.UsBankAccount`
12+
* Add support for `list` method on resource `v2.core.vault.GbBankAccount`
13+
* Add support for new value `verification_data_not_found` on enums `Account.FutureRequirement.Error.code`, `Account.Requirement.Error.code`, `BankAccount.FutureRequirement.Error.code`, `BankAccount.Requirement.Error.code`, `Capability.FutureRequirement.Error.code`, `Capability.Requirement.Error.code`, `Person.FutureRequirement.Error.code`, and `Person.Requirement.Error.code`
14+
* Add support for `payment_portal_url` on `Charge.PaymentMethodDetail.Rechnung`, `PaymentAttemptRecord.PaymentMethodDetail.Rechnung`, and `PaymentRecord.PaymentMethodDetail.Rechnung`
15+
* Add support for `tax_id_element` on `CustomerSession.Component` and `CustomerSessionCreateParamsComponent`
16+
* Add support for `starting_after` on `PaymentAttemptRecordListParams`
17+
* Add support for new value `solana` on enums `PaymentAttemptRecord.PaymentMethodDetail.Crypto.network` and `PaymentRecord.PaymentMethodDetail.Crypto.network`
18+
* Add support for `reference` on `PaymentIntentAmountDetailsLineItem.PaymentMethodOption.Klarna`, `PaymentIntentCaptureParamsAmountDetailLineItemPaymentMethodOptionKlarna`, `PaymentIntentConfirmParamsAmountDetailLineItemPaymentMethodOptionKlarna`, `PaymentIntentCreateParamsAmountDetailLineItemPaymentMethodOptionKlarna`, `PaymentIntentIncrementAuthorizationParamsAmountDetailLineItemPaymentMethodOptionKlarna`, and `PaymentIntentModifyParamsAmountDetailLineItemPaymentMethodOptionKlarna`
19+
* Change `PaymentIntent.PaymentDetail.customer_reference` to be required
20+
* Change `PaymentIntent.PaymentDetail.order_reference` to be required
21+
* Add support for `subscription_reference` on `PaymentIntentAmountDetailsLineItem.PaymentMethodOption.Klarna`
22+
* Add support for `closed` on `V2.Core.Account` and `v2.core.AccountListParams`
23+
* Add support for new value `payment_method` on enums `V2.Core.Account.Configuration.Customer.AutomaticIndirectTax.location_source`, `v2.core.AccountCreateParamsConfigurationCustomerAutomaticIndirectTax.location_source`, and `v2.core.AccountModifyParamsConfigurationCustomerAutomaticIndirectTax.location_source`
24+
* Add support for `usd` on `V2.Core.Account.Configuration.Storer.Capability.HoldsCurrency`, `v2.core.AccountCreateParamsConfigurationStorerCapabilityHoldsCurrency`, and `v2.core.AccountModifyParamsConfigurationStorerCapabilityHoldsCurrency`
25+
* Add support for new values `application_custom` and `application_express` on enums `V2.Core.Account.Default.Responsibility.fees_collector`, `v2.core.AccountCreateParamsDefaultResponsibility.fees_collector`, and `v2.core.AccountModifyParamsDefaultResponsibility.fees_collector`
26+
* Add support for `representative_declaration` on `V2.Core.Account.Identity.Attestation`, `v2.core.AccountCreateParamsIdentityAttestation`, and `v2.core.AccountModifyParamsIdentityAttestation`
27+
* Add support for new value `holds_currencies.usd` on enum `V2.Core.Account.Requirement.Entry.Impact.RestrictsCapability.capability`
28+
* Add support for `verification` on `V2.Core.Vault.UsBankAccount`
29+
* Add support for `v1_id` on `EventsV2MoneyManagementTransactionCreatedEvent`
30+
* Remove support for thin event `V2BillingBillSettingUpdatedEvent` with related object `v2.billing.BillSetting`
31+
* Add support for error code `payment_intent_rate_limit_exceeded` on `QuotePreviewInvoice.LastFinalizationError`
32+
* Add support for error codes `blocked_payout_method_crypto_wallet` and `unsupported_payout_method_crypto_wallet` on `BlockedByStripeError`
33+
* Add support for error code `outbound_flow_from_closed_financial_account_unsupported` on `FeatureNotEnabledError`
34+
* Add support for error code `limit_payout_method_crypto_wallet` on `QuotaExceededError`
35+
* [#1617](https://github.com/stripe/stripe-python/pull/1617) Update generated code for beta
36+
* Add support for `last_seen_at` on `Terminal.Reader`
37+
* Add support for new value `2025-10-29.clover` on enum `WebhookEndpointCreateParams.api_version`
38+
339
## 13.2.0a2 - 2025-10-30
440
* [#1659](https://github.com/stripe/stripe-python/pull/1659) Update generated code for private-preview
541
* Change `delegated_checkout.RequestedSessionModifyParamsLineItemDetail.quantity` to be required
@@ -63,42 +99,12 @@
6399
* Add support for `external_amount` on `V2.MoneyManagement.ReceivedCredit` and `V2.MoneyManagement.ReceivedDebit`
64100
* Add support for error code `payment_intent_rate_limit_exceeded` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `QuotePreviewInvoice.LastFinalizationError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, and `StripeError`
65101

66-
## 13.2.0b1 - 2025-10-29
102+
## 13.1.2 - 2025-11-04
103+
* [#1661](https://github.com/stripe/stripe-python/pull/1661) Add support for value `payment_record` to enum `InvoicePayment.payment.type`
67104

68-
This release changes the pinned API version to `2025-10-29.preview`.
105+
## 13.1.1 - 2025-10-31
106+
* [#1660](https://github.com/stripe/stripe-python/pull/1660) Fix `stripe-context` header not being included in paged list requests
69107

70-
* [#1655](https://github.com/stripe/stripe-python/pull/1655) Update generated code for beta
71-
* Add support for `crypto_storer` on `v2.core.AccountModifyParamsIdentityAttestationTermsOfService`
72-
* [#1624](https://github.com/stripe/stripe-python/pull/1624) Update generated code for beta
73-
* Add support for `modify` method on resource `v2.money_management.FinancialAccount`
74-
* Add support for `confirm_microdeposits`, `list`, and `send_microdeposits` methods on resource `v2.core.vault.UsBankAccount`
75-
* Add support for `list` method on resource `v2.core.vault.GbBankAccount`
76-
* Add support for new value `verification_data_not_found` on enums `Account.FutureRequirement.Error.code`, `Account.Requirement.Error.code`, `BankAccount.FutureRequirement.Error.code`, `BankAccount.Requirement.Error.code`, `Capability.FutureRequirement.Error.code`, `Capability.Requirement.Error.code`, `Person.FutureRequirement.Error.code`, and `Person.Requirement.Error.code`
77-
* Add support for `payment_portal_url` on `Charge.PaymentMethodDetail.Rechnung`, `PaymentAttemptRecord.PaymentMethodDetail.Rechnung`, and `PaymentRecord.PaymentMethodDetail.Rechnung`
78-
* Add support for `tax_id_element` on `CustomerSession.Component` and `CustomerSessionCreateParamsComponent`
79-
* Add support for `starting_after` on `PaymentAttemptRecordListParams`
80-
* Add support for new value `solana` on enums `PaymentAttemptRecord.PaymentMethodDetail.Crypto.network` and `PaymentRecord.PaymentMethodDetail.Crypto.network`
81-
* Add support for `reference` on `PaymentIntentAmountDetailsLineItem.PaymentMethodOption.Klarna`, `PaymentIntentCaptureParamsAmountDetailLineItemPaymentMethodOptionKlarna`, `PaymentIntentConfirmParamsAmountDetailLineItemPaymentMethodOptionKlarna`, `PaymentIntentCreateParamsAmountDetailLineItemPaymentMethodOptionKlarna`, `PaymentIntentIncrementAuthorizationParamsAmountDetailLineItemPaymentMethodOptionKlarna`, and `PaymentIntentModifyParamsAmountDetailLineItemPaymentMethodOptionKlarna`
82-
* Change `PaymentIntent.PaymentDetail.customer_reference` to be required
83-
* Change `PaymentIntent.PaymentDetail.order_reference` to be required
84-
* Add support for `subscription_reference` on `PaymentIntentAmountDetailsLineItem.PaymentMethodOption.Klarna`
85-
* Add support for `closed` on `V2.Core.Account` and `v2.core.AccountListParams`
86-
* Add support for new value `payment_method` on enums `V2.Core.Account.Configuration.Customer.AutomaticIndirectTax.location_source`, `v2.core.AccountCreateParamsConfigurationCustomerAutomaticIndirectTax.location_source`, and `v2.core.AccountModifyParamsConfigurationCustomerAutomaticIndirectTax.location_source`
87-
* Add support for `usd` on `V2.Core.Account.Configuration.Storer.Capability.HoldsCurrency`, `v2.core.AccountCreateParamsConfigurationStorerCapabilityHoldsCurrency`, and `v2.core.AccountModifyParamsConfigurationStorerCapabilityHoldsCurrency`
88-
* Add support for new values `application_custom` and `application_express` on enums `V2.Core.Account.Default.Responsibility.fees_collector`, `v2.core.AccountCreateParamsDefaultResponsibility.fees_collector`, and `v2.core.AccountModifyParamsDefaultResponsibility.fees_collector`
89-
* Add support for `representative_declaration` on `V2.Core.Account.Identity.Attestation`, `v2.core.AccountCreateParamsIdentityAttestation`, and `v2.core.AccountModifyParamsIdentityAttestation`
90-
* Add support for new value `holds_currencies.usd` on enum `V2.Core.Account.Requirement.Entry.Impact.RestrictsCapability.capability`
91-
* Add support for `verification` on `V2.Core.Vault.UsBankAccount`
92-
* Add support for `v1_id` on `EventsV2MoneyManagementTransactionCreatedEvent`
93-
* Remove support for thin event `V2BillingBillSettingUpdatedEvent` with related object `v2.billing.BillSetting`
94-
* Add support for error code `payment_intent_rate_limit_exceeded` on `QuotePreviewInvoice.LastFinalizationError`
95-
* Add support for error codes `blocked_payout_method_crypto_wallet` and `unsupported_payout_method_crypto_wallet` on `BlockedByStripeError`
96-
* Add support for error code `outbound_flow_from_closed_financial_account_unsupported` on `FeatureNotEnabledError`
97-
* Add support for error code `limit_payout_method_crypto_wallet` on `QuotaExceededError`
98-
* [#1617](https://github.com/stripe/stripe-python/pull/1617) Update generated code for beta
99-
* Add support for `last_seen_at` on `Terminal.Reader`
100-
* Add support for new value `2025-10-29.clover` on enum `WebhookEndpointCreateParams.api_version`
101-
102108
## 13.1.0 - 2025-10-29
103109

104110
This release changes the pinned API version to `2025-10-29.clover`.

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2106
1+
v2110

stripe/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ def add_beta_version(
604604
TransferReversalService as TransferReversalService,
605605
)
606606
from stripe._transfer_service import TransferService as TransferService
607+
from stripe._transit_balance import TransitBalance as TransitBalance
607608
from stripe._treasury_service import TreasuryService as TreasuryService
608609
from stripe._updateable_api_resource import (
609610
UpdateableAPIResource as UpdateableAPIResource,
@@ -985,6 +986,7 @@ def add_beta_version(
985986
"Transfer": ("stripe._transfer", False),
986987
"TransferReversalService": ("stripe._transfer_reversal_service", False),
987988
"TransferService": ("stripe._transfer_service", False),
989+
"TransitBalance": ("stripe._transit_balance", False),
988990
"TreasuryService": ("stripe._treasury_service", False),
989991
"UpdateableAPIResource": ("stripe._updateable_api_resource", False),
990992
"convert_to_stripe_object": ("stripe._util", False),

stripe/_api_requestor.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@
4545
StripeStreamResponse,
4646
StripeStreamResponseAsync,
4747
)
48-
from stripe._request_options import RequestOptions, merge_options
48+
from stripe._request_options import (
49+
PERSISTENT_OPTIONS_KEYS,
50+
RequestOptions,
51+
merge_options,
52+
)
4953
from stripe._requestor_options import (
5054
RequestorOptions,
5155
_GlobalRequestorOptions,
@@ -124,12 +128,15 @@ def _get_http_client(self) -> HTTPClient:
124128
return stripe.default_http_client
125129
return client
126130

127-
def _replace_options(
131+
def _new_requestor_with_options(
128132
self, options: Optional[RequestOptions]
129133
) -> "_APIRequestor":
134+
"""
135+
Returns a new _APIRequestor instance with the same HTTP client but a (potentially) updated set of options. Useful for ensuring the original isn't modified, but any options the original had are still used.
136+
"""
130137
options = options or {}
131138
new_options = self._options.to_dict()
132-
for key in ["api_key", "stripe_account", "stripe_version"]:
139+
for key in PERSISTENT_OPTIONS_KEYS:
133140
if key in options and options[key] is not None:
134141
new_options[key] = options[key]
135142
return _APIRequestor(
@@ -168,7 +175,9 @@ def _global_instance(cls):
168175
def _global_with_options(
169176
**params: Unpack[RequestOptions],
170177
) -> "_APIRequestor":
171-
return _APIRequestor._global_instance()._replace_options(params)
178+
return _APIRequestor._global_instance()._new_requestor_with_options(
179+
params
180+
)
172181

173182
@classmethod
174183
def _format_app_info(cls, info):
@@ -190,7 +199,7 @@ def request(
190199
usage: Optional[List[str]] = None,
191200
) -> "StripeObject":
192201
api_mode = get_api_mode(url)
193-
requestor = self._replace_options(options)
202+
requestor = self._new_requestor_with_options(options)
194203
rbody, rcode, rheaders = requestor.request_raw(
195204
method.lower(),
196205
url,
@@ -224,7 +233,7 @@ async def request_async(
224233
usage: Optional[List[str]] = None,
225234
) -> "StripeObject":
226235
api_mode = get_api_mode(url)
227-
requestor = self._replace_options(options)
236+
requestor = self._new_requestor_with_options(options)
228237
rbody, rcode, rheaders = await requestor.request_raw_async(
229238
method.lower(),
230239
url,

stripe/_charge.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from stripe._review import Review
3939
from stripe._source import Source
4040
from stripe._transfer import Transfer
41+
from stripe._transit_balance import TransitBalance
4142
from stripe.params._charge_capture_params import ChargeCaptureParams
4243
from stripe.params._charge_create_params import ChargeCreateParams
4344
from stripe.params._charge_list_params import ChargeListParams
@@ -2339,6 +2340,10 @@ class TransferData(StripeObject):
23392340
ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request.
23402341
"""
23412342

2343+
allocated_funds: Optional["TransitBalance"]
2344+
"""
2345+
Funds that are in transit and destined for another balance or another connected account.
2346+
"""
23422347
amount: int
23432348
"""
23442349
Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).

stripe/_error_object.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def refresh_from(
3939
values=values,
4040
partial=partial,
4141
last_response=last_response,
42-
requestor=self._requestor._replace_options(
42+
requestor=self._requestor._new_requestor_with_options(
4343
{
4444
"api_key": api_key,
4545
"stripe_version": stripe_version,
@@ -102,7 +102,7 @@ def refresh_from(
102102
values=values,
103103
partial=partial,
104104
last_response=last_response,
105-
requestor=self._requestor._replace_options(
105+
requestor=self._requestor._new_requestor_with_options(
106106
{
107107
"api_key": api_key,
108108
"stripe_version": stripe_version,

stripe/_invoice_payment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Payment(StripeObject):
4747
"""
4848
ID of the PaymentRecord associated with this payment when `type` is `payment_record`.
4949
"""
50-
type: Literal["charge", "payment_intent"]
50+
type: Literal["charge", "payment_intent", "payment_record"]
5151
"""
5252
Type of payment object associated with this invoice payment.
5353
"""

stripe/_object_classes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@
349349
"token": ("stripe._token", "Token"),
350350
"topup": ("stripe._topup", "Topup"),
351351
"transfer": ("stripe._transfer", "Transfer"),
352+
"transit_balance": ("stripe._transit_balance", "TransitBalance"),
352353
"treasury.credit_reversal": (
353354
"stripe.treasury._credit_reversal",
354355
"CreditReversal",
@@ -581,6 +582,11 @@
581582
"stripe.v2.payments._off_session_payment",
582583
"OffSessionPayment",
583584
),
585+
"v2.reporting.report": ("stripe.v2.reporting._report", "Report"),
586+
"v2.reporting.report_run": (
587+
"stripe.v2.reporting._report_run",
588+
"ReportRun",
589+
),
584590
"v2.tax.automatic_rule": (
585591
"stripe.v2.tax._automatic_rule",
586592
"AutomaticRule",

stripe/_request_options.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,18 @@ def merge_options(
5454
}
5555

5656

57+
PERSISTENT_OPTIONS_KEYS = {
58+
"api_key",
59+
"stripe_version",
60+
"stripe_account",
61+
"stripe_context",
62+
}
63+
"""
64+
These are the keys in RequestOptions that should persist across requests made
65+
by the same requestor.
66+
"""
67+
68+
5769
def extract_options_from_dict(
5870
d: Optional[Mapping[str, Any]],
5971
) -> Tuple[RequestOptions, Dict[str, Any]]:

0 commit comments

Comments
 (0)