Skip to content
Open
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
86 changes: 86 additions & 0 deletions .hark/changes/2026-09-23_stripe-openapi_16a8e9ee.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 @@
638708680336c05240c03b40897c5a750bffd773
c6e6c59f2abca2e655c05194c60737d51f7e704f
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2485
v2516
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ There are a few options for enabling it:
logging.getLogger('stripe').setLevel(logging.DEBUG)
```

### Suppressing Stripe notices

The SDK may print notices from Stripe that it receives in the `Stripe-Notice` header. These notices are always printed when the SDK runs in an agent environment. For API calls to test accounts or sandboxes, notices are also printed when the SDK runs outside an agent environment. To suppress notices when the SDK runs outside an agent environment, set the `STRIPE_SUPPRESS_NOTICES` environment variable to `true` before running your integration.

### Accessing response code and headers

You can access the HTTP response code and headers using the `last_response` property of the returned resource.
Expand Down
2 changes: 2 additions & 0 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ def add_beta_version(
QuotaExceededError as QuotaExceededError,
RateLimitError as RateLimitError,
RecipientNotNotifiableError as RecipientNotNotifiableError,
ServiceUnavailableError as ServiceUnavailableError,
SignatureVerificationError as SignatureVerificationError,
StripeError as StripeError,
StripeErrorWithParamCode as StripeErrorWithParamCode,
Expand Down Expand Up @@ -879,6 +880,7 @@ def add_beta_version(
"QuotaExceededError": ("stripe._error", False),
"RateLimitError": ("stripe._error", False),
"RecipientNotNotifiableError": ("stripe._error", False),
"ServiceUnavailableError": ("stripe._error", False),
"SignatureVerificationError": ("stripe._error", False),
"StripeError": ("stripe._error", False),
"StripeErrorWithParamCode": ("stripe._error", False),
Expand Down
30 changes: 26 additions & 4 deletions stripe/_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ class Capabilities(StripeObject):
"""
The status of the blik payments capability of the account, or whether the account can directly process blik charges.
"""
blik_recurring_payments: Optional[
Union[Literal["active", "inactive", "pending"], str]
]
"""
The status of the BLIK recurring payments capability of the account, or whether the account can accept recurring and subscription BLIK payments.
"""
boleto_payments: Optional[
Union[Literal["active", "inactive", "pending"], str]
]
Expand Down Expand Up @@ -905,7 +911,7 @@ class Verification(StripeObject):
class Document(StripeObject):
back: Optional[ExpandableField["File"]]
"""
The back of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file).
The back of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file).
"""
details: Optional[str]
"""
Expand All @@ -917,7 +923,7 @@ class Document(StripeObject):
"""
front: Optional[ExpandableField["File"]]
"""
The front of a document returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file).
The front of a document returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `additional_verification`. Note that `additional_verification` files are [not downloadable](https://docs.stripe.com/file-upload#uploading-a-file).
"""

document: Document
Expand Down Expand Up @@ -1154,8 +1160,10 @@ class Details(StripeObject):
"external_request",
"information_missing",
"invalid_address_city_state_postal_code",
"invalid_address_cmra_address",
"invalid_address_highway_contract_box",
"invalid_address_private_mailbox",
"invalid_address_registered_agent_address",
"invalid_business_profile_name",
"invalid_business_profile_name_denylisted",
"invalid_company_name_denylisted",
Expand Down Expand Up @@ -1297,7 +1305,7 @@ class Details(StripeObject):
]
]
"""
This is typed as an enum for consistency with `requirements.disabled_reason`.
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`.
"""
errors: Optional[List[Error]]
"""
Expand Down Expand Up @@ -1345,8 +1353,10 @@ class Details(StripeObject):
"external_request",
"information_missing",
"invalid_address_city_state_postal_code",
"invalid_address_cmra_address",
"invalid_address_highway_contract_box",
"invalid_address_private_mailbox",
"invalid_address_registered_agent_address",
"invalid_business_profile_name",
"invalid_business_profile_name_denylisted",
"invalid_company_name_denylisted",
Expand Down Expand Up @@ -1488,7 +1498,7 @@ class Details(StripeObject):
]
]
"""
If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://docs.stripe.com/connect/handling-api-verification).
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`.
"""
errors: Optional[List[Error]]
"""
Expand Down Expand Up @@ -1582,6 +1592,16 @@ class Branding(StripeObject):
A CSS hex color value representing the secondary branding color for this account
"""

class Capital(StripeObject):
allowed_payout_destinations: Optional[List[str]]
"""
The payout destinations allowed for Capital financing payouts.
"""
excluded_payout_destinations: Optional[List[str]]
"""
The payout destinations excluded from Capital financing payouts.
"""

class CardIssuing(StripeObject):
class TosAcceptance(StripeObject):
date: Optional[int]
Expand Down Expand Up @@ -1825,6 +1845,7 @@ class WechatPayPayments(StripeObject):
bacs_debit_payments: Optional[BacsDebitPayments]
bank_bca_onboarding: Optional[BankBcaOnboarding]
branding: Branding
capital: Optional[Capital]
card_issuing: Optional[CardIssuing]
card_payments: CardPayments
dashboard: Dashboard
Expand All @@ -1841,6 +1862,7 @@ class WechatPayPayments(StripeObject):
"bacs_debit_payments": BacsDebitPayments,
"bank_bca_onboarding": BankBcaOnboarding,
"branding": Branding,
"capital": Capital,
"card_issuing": CardIssuing,
"card_payments": CardPayments,
"dashboard": Dashboard,
Expand Down
29 changes: 25 additions & 4 deletions stripe/_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,31 @@
_default_proxy: Optional[str] = None


def _maybe_emit_stripe_notice(rheaders: Mapping[str, str]) -> None:
def _maybe_emit_stripe_notice(
rheaders: Mapping[str, str],
environ: Optional[Mapping[str, str]] = None,
) -> None:
notice = rheaders.get("Stripe-Notice")
if notice:
import warnings
if not notice:
return

environ = os.environ if environ is None else environ
ai_agent = _APIRequestor._detect_ai_agent(environ)
if (
not ai_agent
and environ.get("STRIPE_SUPPRESS_NOTICES", "").lower() == "true"
):
return

if not ai_agent:
notice += (
"\nTo suppress Stripe notices in test and sandbox environments, "
"set the STRIPE_SUPPRESS_NOTICES environment variable to true."
)

import warnings

warnings.warn(notice)
warnings.warn(notice)


def is_v2_delete_resp(method: str, api_mode: ApiMode) -> bool:
Expand Down Expand Up @@ -442,6 +461,8 @@ def specific_v2_api_error(self, rbody, rcode, resp, rheaders, error_data):
return error.RateLimitError(**error_args)
elif type == "recipient_not_notifiable":
return error.RecipientNotNotifiableError(**error_args)
elif type == "service_unavailable":
return error.ServiceUnavailableError(**error_args)
elif type == "temporary_session_expired":
return error.TemporarySessionExpiredError(**error_args)
# switchCases: The end of the section generated from our OpenAPI spec
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-16.preview"
CURRENT = "2026-09-23.preview"
CURRENT_MAJOR = ""
6 changes: 5 additions & 1 deletion stripe/_balance.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ class SourceTypes(StripeObject):
"""
ID of the external account for this net balance (not expandable).
"""
payout_method: Optional[str]
"""
ID of the v2 Payout Method for this net balance (not expandable).
"""
source_types: Optional[SourceTypes]
_inner_class_types = {"source_types": SourceTypes}

Expand Down Expand Up @@ -382,7 +386,7 @@ class SourceTypes(StripeObject):

available: List[Available]
"""
Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://api.stripe.com#transfers) or [Payouts API](https://api.stripe.com#payouts). You can find the available balance for each currency and payment type in the `source_types` property.
Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://docs.stripe.com/api#transfers) or [Payouts API](https://docs.stripe.com/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property.
"""
connect_reserved: Optional[List[ConnectReserved]]
"""
Expand Down
4 changes: 4 additions & 0 deletions stripe/_balance_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class BalanceSettings(
class Payments(StripeObject):
class Payouts(StripeObject):
class AutomaticTransferRulesByCurrency(StripeObject):
destination_currency: Optional[str]
"""
The currency of the FinancialAccount balance that receives the automatic transfer.
"""
payout_method: str
"""
The ID of the FinancialAccount that funds will be transferred to during automatic transfers.
Expand Down
4 changes: 4 additions & 0 deletions stripe/_bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,10 @@ class Details(StripeObject):
"external_request",
"information_missing",
"invalid_address_city_state_postal_code",
"invalid_address_cmra_address",
"invalid_address_highway_contract_box",
"invalid_address_private_mailbox",
"invalid_address_registered_agent_address",
"invalid_business_profile_name",
"invalid_business_profile_name_denylisted",
"invalid_company_name_denylisted",
Expand Down Expand Up @@ -189,8 +191,10 @@ class Details(StripeObject):
"external_request",
"information_missing",
"invalid_address_city_state_postal_code",
"invalid_address_cmra_address",
"invalid_address_highway_contract_box",
"invalid_address_private_mailbox",
"invalid_address_registered_agent_address",
"invalid_business_profile_name",
"invalid_business_profile_name_denylisted",
"invalid_company_name_denylisted",
Expand Down
4 changes: 4 additions & 0 deletions stripe/_capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ class Details(StripeObject):
"external_request",
"information_missing",
"invalid_address_city_state_postal_code",
"invalid_address_cmra_address",
"invalid_address_highway_contract_box",
"invalid_address_private_mailbox",
"invalid_address_registered_agent_address",
"invalid_business_profile_name",
"invalid_business_profile_name_denylisted",
"invalid_company_name_denylisted",
Expand Down Expand Up @@ -243,8 +245,10 @@ class Details(StripeObject):
"external_request",
"information_missing",
"invalid_address_city_state_postal_code",
"invalid_address_cmra_address",
"invalid_address_highway_contract_box",
"invalid_address_private_mailbox",
"invalid_address_registered_agent_address",
"invalid_business_profile_name",
"invalid_business_profile_name_denylisted",
"invalid_company_name_denylisted",
Expand Down
14 changes: 13 additions & 1 deletion stripe/_charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -927,7 +927,7 @@ class ShippingAddress(StripeObject):
"""
electronic_commerce_indicator: Optional[str]
"""
The Electronic Commerce Indicator (ECI) returned by the card network in the authorization response. Indicates the level of authentication used. Only populated for Visa and Mastercard transactions. The response value is the source of truth; it may differ from the request value if the network downgraded the transaction.
The Electronic Commerce Indicator (ECI) returned by the card network in the authorization response. Indicates the level of authentication used. Only populated for Visa and Mastercard transactions. This is the network's final ECI and can differ from the request value. An authenticated ECI alone doesn't determine liability shift.
"""
exp_month: int
"""
Expand Down Expand Up @@ -1004,6 +1004,18 @@ class ShippingAddress(StripeObject):
"""
Status of a card based on the card issuer.
"""
setup_credential_usage: Optional[
Union[Literal["installment", "recurring", "unscheduled"], str]
]
"""
The payment_method_options.card.setup_credential_usage value that was passed when setup_future_usage was present at confirmation, one of `recurring`, `unscheduled`, or `installment`
"""
stored_credential_usage: Optional[
Union[Literal["installment", "recurring", "unscheduled"], str]
]
"""
The payment_method_options.card.stored_credential_usage value that was passed for an off session, merchant-initiated transaction, one of `recurring`, `unscheduled`, `on_session`, or `installment`
"""
three_d_secure: Optional[ThreeDSecure]
"""
Populated if this transaction used 3D Secure authentication.
Expand Down
4 changes: 2 additions & 2 deletions stripe/_coupon.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class Coupon(
):
"""
A coupon contains information about a percent-off or amount-off discount you
might want to apply to a customer. Coupons may be applied to [subscriptions](https://api.stripe.com#subscriptions), [invoices](https://api.stripe.com#invoices),
[checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://api.stripe.com#quotes), and more. Coupons do not work with conventional one-off [charges](https://docs.stripe.com/api/charges/create) or [payment intents](https://docs.stripe.com/api/payment_intents).
might want to apply to a customer. Coupons may be applied to [subscriptions](https://docs.stripe.com/api#subscriptions), [invoices](https://docs.stripe.com/api#invoices),
[checkout sessions](https://docs.stripe.com/api/checkout/sessions), [quotes](https://docs.stripe.com/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://docs.stripe.com/api/charges/create) or [payment intents](https://docs.stripe.com/api/payment_intents).
"""

OBJECT_NAME: ClassVar[Literal["coupon"]] = "coupon"
Expand Down
2 changes: 1 addition & 1 deletion stripe/_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ class Location(StripeObject):

address: Optional[Address]
"""
The customer's address.
The customer's billing address.
"""
balance: Optional[int]
"""
Expand Down
14 changes: 14 additions & 0 deletions stripe/_customer_cash_balance_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ class GbBankTransfer(StripeObject):
"""
The last 4 digits of the account number of the sender of the funding.
"""
bic: Optional[str]
"""
The BIC of the bank of the sender of the funding.
"""
iban_last4: Optional[str]
"""
The last 4 digits of the IBAN of the sender of the funding.
"""
network: Optional[
Union[Literal["bacs", "chaps", "fps", "swift"], str]
]
"""
The banking network used for this funding.
"""
sender_name: Optional[str]
"""
The full name of the sender, as supplied by the sending bank.
Expand Down
4 changes: 4 additions & 0 deletions stripe/_customer_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ class Features(StripeObject):

If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"].
"""
payment_method_preselect: Optional[str]
"""
The ID of a saved payment method to select when the Payment Element renders, for example `pm_1MqLiJLkdIwHu7ixUEgbFdYF`. Takes precedence over the customer's default payment method. If the ID doesn't match one of the payment methods the Element is displaying, the Element selects a payment method as it normally would and no error is returned. Preselecting a payment method never changes which payment methods the Element displays, and never modifies the payment method, the customer, or this session. Customer Sessions can't be updated, so create a new one to change the preselection.
"""
payment_method_redisplay: Union[
Literal["disabled", "enabled"], str
]
Expand Down
2 changes: 1 addition & 1 deletion stripe/_discount.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class Discount(StripeObject):
"""
A discount represents the actual application of a [coupon](https://api.stripe.com#coupons) or [promotion code](https://api.stripe.com#promotion_codes).
A discount represents the actual application of a [coupon](https://docs.stripe.com/api#coupons) or [promotion code](https://docs.stripe.com/api#promotion_codes).
It contains information about when the discount began, when it will end, and what it is applied to.

Related guide: [Applying discounts to subscriptions](https://docs.stripe.com/billing/subscriptions/discounts)
Expand Down
2 changes: 1 addition & 1 deletion stripe/_dispute.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Card(StripeObject):
"""
supporting_files: Optional[List[str]]
"""
One or more document IDs returned by a [file upload](https://api.stripe.com#create_file) with a `purpose` value of `dispute_evidence` to support the appeal.
One or more document IDs returned by a [file upload](https://docs.stripe.com/api#create_file) with a `purpose` value of `dispute_evidence` to support the appeal.
"""

card: Optional[Card]
Expand Down
4 changes: 4 additions & 0 deletions stripe/_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,10 @@ class RecipientNotNotifiableError(StripeError):
pass


class ServiceUnavailableError(StripeError):
pass


class TemporarySessionExpiredError(StripeError):
pass

Expand Down
Loading
Loading