Skip to content

Commit 0317b38

Browse files
Merge pull request #1839 from stripe/latest-codegen-private-preview
Update generated code for private-preview
2 parents 1926bfd + 25858df commit 0317b38

137 files changed

Lines changed: 4027 additions & 213 deletions

File tree

Some content is hidden

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

CHANGELOG.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,46 @@ This release changes the pinned API version to 2026-06-24.preview.
101101
* Add support for error codes `us_bank_account_microdeposits_cannot_be_confirmed` and `us_bank_account_microdeposits_cannot_be_sent` on `ControlledByAlternateResourceError`
102102
* Add support for error code `payout_intent_not_cancelable` on `NotCancelableError`
103103

104+
## 15.3.0 - 2026-06-24
105+
This release changes the pinned API version to 2026-06-24.dahlia.
106+
107+
* [#1836](https://github.com/stripe/stripe-python/pull/1836) Update generated code
108+
* Add support for `release_details` on `Reserve.Hold`
109+
* ⚠️ Add support for new value `tax_fund` on enum `BalanceTransaction.type`
110+
* Change `Billing.CreditGrant.priority` to be required
111+
* Add support for `buyer_id` on `Charge.PaymentMethodDetail.Bizum`, `ConfirmationToken.PaymentMethodPreview.Bizum`, `ConfirmationToken.PaymentMethodPreview.Blik`, `PaymentAttemptRecord.PaymentMethodDetail.Bizum`, `PaymentMethod.Bizum`, `PaymentMethod.Blik`, and `PaymentRecord.PaymentMethodDetail.Bizum`
112+
* Add support for `transaction_link_id` on `Charge.PaymentMethodDetail.Card`
113+
* ⚠️ Add support for new value `sui` on enums `Charge.PaymentMethodDetail.Crypto.network`, `PaymentAttemptRecord.PaymentMethodDetail.Crypto.network`, and `PaymentRecord.PaymentMethodDetail.Crypto.network`
114+
* ⚠️ Add support for new value `usdsui` on enums `Charge.PaymentMethodDetail.Crypto.token_currency`, `PaymentAttemptRecord.PaymentMethodDetail.Crypto.token_currency`, and `PaymentRecord.PaymentMethodDetail.Crypto.token_currency`
115+
* Add support for `fingerprint` on `Charge.PaymentMethodDetail.Pix`, `ConfirmationToken.PaymentMethodPreview.Pix`, `PaymentMethod.Pix`, and `SetupAttempt.PaymentMethodDetail.Pix`
116+
* Add support for `sunbit` on `Checkout.Session.PaymentMethodOption`, `PaymentIntent.PaymentMethodOption`, `PaymentIntentConfirmParamsPaymentMethodOption`, `PaymentIntentCreateParamsPaymentMethodOption`, `PaymentIntentModifyParamsPaymentMethodOption`, and `checkout.SessionCreateParamsPaymentMethodOption`
117+
* Add support for `billing_cycle_anchor_config` on `checkout.SessionCreateParamsSubscriptionDatum`
118+
* Add support for `wechat_pay` on `Checkout.Session.PaymentMethodOption`
119+
* Add support for `mastercard_compliance` on `Dispute.Evidence.EnhancedEvidence`, `Dispute.EvidenceDetail.EnhancedEligibility`, and `DisputeModifyParamsEvidenceEnhancedEvidence`
120+
* ⚠️ Add support for new value `mastercard_compliance` on enum `Dispute.enhanced_eligibility_types`
121+
* Add support for `status_details` on `FinancialConnections.Account`
122+
* ⚠️ Add support for new value `validated` on enum `Identity.VerificationSession.Redaction.status`
123+
* Add support for new value `satispay` on enums `InvoiceCreateParamsPaymentSetting.payment_method_types`, `InvoiceModifyParamsPaymentSetting.payment_method_types`, `SubscriptionCreateParamsPaymentSetting.payment_method_types`, and `SubscriptionModifyParamsPaymentSetting.payment_method_types`
124+
* ⚠️ Add support for new value `satispay` on enums `Invoice.PaymentSetting.payment_method_types` and `Subscription.PaymentSetting.payment_method_types`
125+
* ⚠️ Remove support for `stored_credential_usage` on `PaymentAttemptRecord.PaymentMethodDetail.Card` and `PaymentRecord.PaymentMethodDetail.Card`
126+
* ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.description` and `PaymentRecord.PaymentMethodDetail.Card.description` to be optional
127+
* ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.iin` and `PaymentRecord.PaymentMethodDetail.Card.iin` to be optional
128+
* ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.issuer` and `PaymentRecord.PaymentMethodDetail.Card.issuer` to be optional
129+
* Add support for `setup_future_usage` on `PaymentIntent.PaymentMethodOption.Satispay`, `PaymentIntentConfirmParamsPaymentMethodOptionSatispay`, `PaymentIntentCreateParamsPaymentMethodOptionSatispay`, and `PaymentIntentModifyParamsPaymentMethodOptionSatispay`
130+
* Change `PaymentRecordReportRefundParams.refunded` to be optional
131+
* Add support for `satispay` on `SetupAttempt.PaymentMethodDetail`
132+
* Add support for `custom_fields`, `description`, and `footer` on `Subscription.InvoiceSetting`, `SubscriptionCreateParamsInvoiceSetting`, and `SubscriptionModifyParamsInvoiceSetting`
133+
* Add support for `payment_method_options` and `payment_method` on `TopupCreateParams`
134+
* Add support for new value `2026-06-24.dahlia` on enum `WebhookEndpointCreateParams.api_version`
135+
* Add support for `mode` on `V2.Commerce.ProductCatalogImport`
136+
* ⚠️ Add support for new value `promotion` on enum `V2.Commerce.ProductCatalogImport.feed_type`
137+
* Add support for `sunbit_payments` on `V2.Core.Account.Configuration.Merchant.Capability`, `v2.core.AccountCreateParamsConfigurationMerchantCapability`, and `v2.core.AccountModifyParamsConfigurationMerchantCapability`
138+
* Add support for `crypto_money_manager` and `money_manager` on `v2.core.AccountModifyParamsIdentityAttestationTermsOfService`
139+
* ⚠️ Remove support for `crypto_storer` and `storer` on `v2.core.AccountModifyParamsIdentityAttestationTermsOfService`
140+
* Add support for new value `promotion` on enum `v2.commerce.ProductCatalogImportCreateParams.feed_type`
141+
* ⚠️ Add support for new value `sunbit_payments` on enum `EventsV2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.updated_capability`
142+
* Add support for error codes `anomalous_money_movement_request`, `failed_tax_calculation`, `financial_account_balance_does_not_support_currency`, `financial_account_capability_not_enabled`, and `financial_account_capability_restricted` on `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, `SetupIntent.LastSetupError`, `StripeError`, and `Terminal.Reader.Action.ApiError`
143+
104144
## 15.3.0a4 - 2026-06-17
105145
* [#1828](https://github.com/stripe/stripe-python/pull/1828) Update generated code for private-preview
106146
* Add support for `retrieve` method on resource `radar.CustomerEvaluation`

CODEGEN_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
088388aa159596ba4e240aeb0bb65d5bb4a562ab
1+
23a0d1c154d81b4b4185658446b2ee07f06f969a

OPENAPI_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v2323
1+
v2342

stripe/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def add_beta_version(
150150
capital as capital,
151151
checkout as checkout,
152152
climate as climate,
153+
crypto as crypto,
153154
delegated_checkout as delegated_checkout,
154155
entitlements as entitlements,
155156
events as events,
@@ -281,6 +282,7 @@ def add_beta_version(
281282
from stripe._credit_note_service import (
282283
CreditNoteService as CreditNoteService,
283284
)
285+
from stripe._crypto_service import CryptoService as CryptoService
284286
from stripe._custom_method import custom_method as custom_method
285287
from stripe._customer import Customer as Customer
286288
from stripe._customer_balance_transaction import (
@@ -688,6 +690,7 @@ def add_beta_version(
688690
"capital": ("stripe.capital", True),
689691
"checkout": ("stripe.checkout", True),
690692
"climate": ("stripe.climate", True),
693+
"crypto": ("stripe.crypto", True),
691694
"delegated_checkout": ("stripe.delegated_checkout", True),
692695
"entitlements": ("stripe.entitlements", True),
693696
"events": ("stripe.events", True),
@@ -784,6 +787,7 @@ def add_beta_version(
784787
False,
785788
),
786789
"CreditNoteService": ("stripe._credit_note_service", False),
790+
"CryptoService": ("stripe._crypto_service", False),
787791
"custom_method": ("stripe._custom_method", False),
788792
"Customer": ("stripe._customer", False),
789793
"CustomerBalanceTransaction": (

stripe/_api_requestor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
NoReturn,
2525
Unpack,
2626
)
27-
import uuid
2827
from urllib.parse import urlsplit, urlunsplit, parse_qs
2928

3029
# breaking circular dependency
@@ -100,6 +99,11 @@ def is_v2_delete_resp(method: str, api_mode: ApiMode) -> bool:
10099
return method == "delete" and api_mode == "V2"
101100

102101

102+
def _generate_idempotency_key() -> str:
103+
b = os.urandom(16)
104+
return f"{b[0:4].hex()}-{b[4:6].hex()}-{b[6:8].hex()}-{b[8:10].hex()}-{b[10:].hex()}"
105+
106+
103107
class _APIRequestor(object):
104108
_instance: ClassVar["_APIRequestor|None"] = None
105109

@@ -618,7 +622,7 @@ def request_headers(
618622

619623
# IKs should be set for all POST requests and v2 delete requests
620624
if method == "post" or (api_mode == "V2" and method == "delete"):
621-
headers.setdefault("Idempotency-Key", str(uuid.uuid4()))
625+
headers.setdefault("Idempotency-Key", _generate_idempotency_key())
622626

623627
if method == "post":
624628
if api_mode == "V2":

stripe/_api_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# -*- coding: utf-8 -*-
22
# File generated from our OpenAPI spec
33
class _ApiVersion:
4-
CURRENT = "2026-06-24.preview"
4+
CURRENT = "2026-07-01.preview"

stripe/_balance_transaction.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class FeeDetail(StripeObject):
200200
"stripe_fee",
201201
"stripe_fx_fee",
202202
"tax_fee",
203+
"tax_fund",
203204
"topup",
204205
"topup_reversal",
205206
"transfer",
@@ -208,17 +209,17 @@ class FeeDetail(StripeObject):
208209
"transfer_refund",
209210
]
210211
"""
211-
Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
212+
Transaction type: `tax_fund`, `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `inbound_transfer`, `inbound_transfer_reversal`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `payout_minimum_balance_hold`, `payout_minimum_balance_release`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `reserve_hold`, `reserve_release`, `stripe_fee`, `stripe_fx_fee`, `stripe_balance_payment_debit`, `stripe_balance_payment_debit_reversal`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, `transfer_refund`, or `fee_credit_funding`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead.
212213
"""
213214

214215
@classmethod
215216
def list(
216217
cls, **params: Unpack["BalanceTransactionListParams"]
217218
) -> ListObject["BalanceTransaction"]:
218219
"""
219-
Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
220+
Returns a list of transactions that have contributed to the Stripe account balance (for example, charges, transfers, and so on). The transactions return in sorted order, with the most recent transactions appearing first.
220221
221-
Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
222+
The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history.
222223
"""
223224
result = cls._static_request(
224225
"get",
@@ -238,9 +239,9 @@ async def list_async(
238239
cls, **params: Unpack["BalanceTransactionListParams"]
239240
) -> ListObject["BalanceTransaction"]:
240241
"""
241-
Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
242+
Returns a list of transactions that have contributed to the Stripe account balance (for example, charges, transfers, and so on). The transactions return in sorted order, with the most recent transactions appearing first.
242243
243-
Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
244+
The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history.
244245
"""
245246
result = await cls._static_request_async(
246247
"get",

stripe/_balance_transaction_service.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ def list(
2424
options: Optional["RequestOptions"] = None,
2525
) -> "ListObject[BalanceTransaction]":
2626
"""
27-
Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
27+
Returns a list of transactions that have contributed to the Stripe account balance (for example, charges, transfers, and so on). The transactions return in sorted order, with the most recent transactions appearing first.
2828
29-
Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
29+
The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history.
3030
"""
3131
return cast(
3232
"ListObject[BalanceTransaction]",
@@ -45,9 +45,9 @@ async def list_async(
4545
options: Optional["RequestOptions"] = None,
4646
) -> "ListObject[BalanceTransaction]":
4747
"""
48-
Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.
48+
Returns a list of transactions that have contributed to the Stripe account balance (for example, charges, transfers, and so on). The transactions return in sorted order, with the most recent transactions appearing first.
4949
50-
Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
50+
The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history.
5151
"""
5252
return cast(
5353
"ListObject[BalanceTransaction]",

stripe/_card.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ class Networks(StripeObject):
4343
The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card.
4444
"""
4545

46+
class Redaction(StripeObject):
47+
status: Literal["processing", "redacted", "validated"]
48+
"""
49+
Indicates whether this object and its related objects have been redacted or not.
50+
"""
51+
4652
account: Optional[ExpandableField["Account"]]
4753
address_city: Optional[str]
4854
"""
@@ -172,6 +178,10 @@ class Networks(StripeObject):
172178
"""
173179
String representing the object's type. Objects of the same type share the same value.
174180
"""
181+
redaction: Optional[Redaction]
182+
"""
183+
Redaction status of this card. If not null, this card is associated to a redaction job.
184+
"""
175185
regulated_status: Optional[Literal["regulated", "unregulated"]]
176186
"""
177187
Status of a card based on the card issuer.
@@ -336,4 +346,8 @@ def retrieve(cls, id, **params):
336346
"(see https://stripe.com/docs/api/external_account_cards/retrieve)."
337347
)
338348

339-
_inner_class_types = {"benefits": Benefits, "networks": Networks}
349+
_inner_class_types = {
350+
"benefits": Benefits,
351+
"networks": Networks,
352+
"redaction": Redaction,
353+
}

0 commit comments

Comments
 (0)