Skip to content
Merged
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,46 @@ This release changes the pinned API version to 2026-06-24.preview.
* Add support for error codes `us_bank_account_microdeposits_cannot_be_confirmed` and `us_bank_account_microdeposits_cannot_be_sent` on `ControlledByAlternateResourceError`
* Add support for error code `payout_intent_not_cancelable` on `NotCancelableError`

## 15.3.0 - 2026-06-24
This release changes the pinned API version to 2026-06-24.dahlia.

* [#1836](https://github.com/stripe/stripe-python/pull/1836) Update generated code
* Add support for `release_details` on `Reserve.Hold`
* ⚠️ Add support for new value `tax_fund` on enum `BalanceTransaction.type`
* Change `Billing.CreditGrant.priority` to be required
* 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`
* Add support for `transaction_link_id` on `Charge.PaymentMethodDetail.Card`
* ⚠️ Add support for new value `sui` on enums `Charge.PaymentMethodDetail.Crypto.network`, `PaymentAttemptRecord.PaymentMethodDetail.Crypto.network`, and `PaymentRecord.PaymentMethodDetail.Crypto.network`
* ⚠️ Add support for new value `usdsui` on enums `Charge.PaymentMethodDetail.Crypto.token_currency`, `PaymentAttemptRecord.PaymentMethodDetail.Crypto.token_currency`, and `PaymentRecord.PaymentMethodDetail.Crypto.token_currency`
* Add support for `fingerprint` on `Charge.PaymentMethodDetail.Pix`, `ConfirmationToken.PaymentMethodPreview.Pix`, `PaymentMethod.Pix`, and `SetupAttempt.PaymentMethodDetail.Pix`
* Add support for `sunbit` on `Checkout.Session.PaymentMethodOption`, `PaymentIntent.PaymentMethodOption`, `PaymentIntentConfirmParamsPaymentMethodOption`, `PaymentIntentCreateParamsPaymentMethodOption`, `PaymentIntentModifyParamsPaymentMethodOption`, and `checkout.SessionCreateParamsPaymentMethodOption`
* Add support for `billing_cycle_anchor_config` on `checkout.SessionCreateParamsSubscriptionDatum`
* Add support for `wechat_pay` on `Checkout.Session.PaymentMethodOption`
* Add support for `mastercard_compliance` on `Dispute.Evidence.EnhancedEvidence`, `Dispute.EvidenceDetail.EnhancedEligibility`, and `DisputeModifyParamsEvidenceEnhancedEvidence`
* ⚠️ Add support for new value `mastercard_compliance` on enum `Dispute.enhanced_eligibility_types`
* Add support for `status_details` on `FinancialConnections.Account`
* ⚠️ Add support for new value `validated` on enum `Identity.VerificationSession.Redaction.status`
* 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`
* ⚠️ Add support for new value `satispay` on enums `Invoice.PaymentSetting.payment_method_types` and `Subscription.PaymentSetting.payment_method_types`
* ⚠️ Remove support for `stored_credential_usage` on `PaymentAttemptRecord.PaymentMethodDetail.Card` and `PaymentRecord.PaymentMethodDetail.Card`
* ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.description` and `PaymentRecord.PaymentMethodDetail.Card.description` to be optional
* ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.iin` and `PaymentRecord.PaymentMethodDetail.Card.iin` to be optional
* ⚠️ Change `PaymentAttemptRecord.PaymentMethodDetail.Card.issuer` and `PaymentRecord.PaymentMethodDetail.Card.issuer` to be optional
* Add support for `setup_future_usage` on `PaymentIntent.PaymentMethodOption.Satispay`, `PaymentIntentConfirmParamsPaymentMethodOptionSatispay`, `PaymentIntentCreateParamsPaymentMethodOptionSatispay`, and `PaymentIntentModifyParamsPaymentMethodOptionSatispay`
* Change `PaymentRecordReportRefundParams.refunded` to be optional
* Add support for `satispay` on `SetupAttempt.PaymentMethodDetail`
* Add support for `custom_fields`, `description`, and `footer` on `Subscription.InvoiceSetting`, `SubscriptionCreateParamsInvoiceSetting`, and `SubscriptionModifyParamsInvoiceSetting`
* Add support for `payment_method_options` and `payment_method` on `TopupCreateParams`
* Add support for new value `2026-06-24.dahlia` on enum `WebhookEndpointCreateParams.api_version`
* Add support for `mode` on `V2.Commerce.ProductCatalogImport`
* ⚠️ Add support for new value `promotion` on enum `V2.Commerce.ProductCatalogImport.feed_type`
* Add support for `sunbit_payments` on `V2.Core.Account.Configuration.Merchant.Capability`, `v2.core.AccountCreateParamsConfigurationMerchantCapability`, and `v2.core.AccountModifyParamsConfigurationMerchantCapability`
* Add support for `crypto_money_manager` and `money_manager` on `v2.core.AccountModifyParamsIdentityAttestationTermsOfService`
* ⚠️ Remove support for `crypto_storer` and `storer` on `v2.core.AccountModifyParamsIdentityAttestationTermsOfService`
* Add support for new value `promotion` on enum `v2.commerce.ProductCatalogImportCreateParams.feed_type`
* ⚠️ Add support for new value `sunbit_payments` on enum `EventsV2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.updated_capability`
* 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`

## 15.3.0a4 - 2026-06-17
* [#1828](https://github.com/stripe/stripe-python/pull/1828) Update generated code for private-preview
* Add support for `retrieve` method on resource `radar.CustomerEvaluation`
Expand Down
2 changes: 1 addition & 1 deletion CODEGEN_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
088388aa159596ba4e240aeb0bb65d5bb4a562ab
23a0d1c154d81b4b4185658446b2ee07f06f969a
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2323
v2342
4 changes: 4 additions & 0 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ def add_beta_version(
capital as capital,
checkout as checkout,
climate as climate,
crypto as crypto,
delegated_checkout as delegated_checkout,
entitlements as entitlements,
events as events,
Expand Down Expand Up @@ -281,6 +282,7 @@ def add_beta_version(
from stripe._credit_note_service import (
CreditNoteService as CreditNoteService,
)
from stripe._crypto_service import CryptoService as CryptoService
from stripe._custom_method import custom_method as custom_method
from stripe._customer import Customer as Customer
from stripe._customer_balance_transaction import (
Expand Down Expand Up @@ -688,6 +690,7 @@ def add_beta_version(
"capital": ("stripe.capital", True),
"checkout": ("stripe.checkout", True),
"climate": ("stripe.climate", True),
"crypto": ("stripe.crypto", True),
"delegated_checkout": ("stripe.delegated_checkout", True),
"entitlements": ("stripe.entitlements", True),
"events": ("stripe.events", True),
Expand Down Expand Up @@ -784,6 +787,7 @@ def add_beta_version(
False,
),
"CreditNoteService": ("stripe._credit_note_service", False),
"CryptoService": ("stripe._crypto_service", False),
"custom_method": ("stripe._custom_method", False),
"Customer": ("stripe._customer", False),
"CustomerBalanceTransaction": (
Expand Down
8 changes: 6 additions & 2 deletions stripe/_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
NoReturn,
Unpack,
)
import uuid
from urllib.parse import urlsplit, urlunsplit, parse_qs

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


def _generate_idempotency_key() -> str:
b = os.urandom(16)
return f"{b[0:4].hex()}-{b[4:6].hex()}-{b[6:8].hex()}-{b[8:10].hex()}-{b[10:].hex()}"


class _APIRequestor(object):
_instance: ClassVar["_APIRequestor|None"] = None

Expand Down Expand Up @@ -618,7 +622,7 @@ def request_headers(

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

if method == "post":
if api_mode == "V2":
Expand Down
2 changes: 1 addition & 1 deletion stripe/_api_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
class _ApiVersion:
CURRENT = "2026-06-24.preview"
CURRENT = "2026-07-01.preview"
11 changes: 6 additions & 5 deletions stripe/_balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class FeeDetail(StripeObject):
"stripe_fee",
"stripe_fx_fee",
"tax_fee",
"tax_fund",
"topup",
"topup_reversal",
"transfer",
Expand All @@ -208,17 +209,17 @@ class FeeDetail(StripeObject):
"transfer_refund",
]
"""
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.
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.
"""

@classmethod
def list(
cls, **params: Unpack["BalanceTransactionListParams"]
) -> ListObject["BalanceTransaction"]:
"""
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.
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.

Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history.
"""
result = cls._static_request(
"get",
Expand All @@ -238,9 +239,9 @@ async def list_async(
cls, **params: Unpack["BalanceTransactionListParams"]
) -> ListObject["BalanceTransaction"]:
"""
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.
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.

Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history.
"""
result = await cls._static_request_async(
"get",
Expand Down
8 changes: 4 additions & 4 deletions stripe/_balance_transaction_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ def list(
options: Optional["RequestOptions"] = None,
) -> "ListObject[BalanceTransaction]":
"""
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.
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.

Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history.
"""
return cast(
"ListObject[BalanceTransaction]",
Expand All @@ -45,9 +45,9 @@ async def list_async(
options: Optional["RequestOptions"] = None,
) -> "ListObject[BalanceTransaction]":
"""
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.
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.

Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.
The previous name of this endpoint was “Balance history,” and it used the path /v1/balance/history.
"""
return cast(
"ListObject[BalanceTransaction]",
Expand Down
16 changes: 15 additions & 1 deletion stripe/_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ class Networks(StripeObject):
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.
"""

class Redaction(StripeObject):
status: Literal["processing", "redacted", "validated"]
"""
Indicates whether this object and its related objects have been redacted or not.
"""

account: Optional[ExpandableField["Account"]]
address_city: Optional[str]
"""
Expand Down Expand Up @@ -172,6 +178,10 @@ class Networks(StripeObject):
"""
String representing the object's type. Objects of the same type share the same value.
"""
redaction: Optional[Redaction]
"""
Redaction status of this card. If not null, this card is associated to a redaction job.
"""
regulated_status: Optional[Literal["regulated", "unregulated"]]
"""
Status of a card based on the card issuer.
Expand Down Expand Up @@ -336,4 +346,8 @@ def retrieve(cls, id, **params):
"(see https://stripe.com/docs/api/external_account_cards/retrieve)."
)

_inner_class_types = {"benefits": Benefits, "networks": Networks}
_inner_class_types = {
"benefits": Benefits,
"networks": Networks,
"redaction": Redaction,
}
Loading
Loading