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 API_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f7784849b5189b7bdf4d850b41365cec53d174b2
c0dacb8d26f5b7c5d68ef88b3f51d40c1eafeab7
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2120
v2124
6 changes: 6 additions & 0 deletions stripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ def add_beta_version(
from stripe._balance_transaction_service import (
BalanceTransactionService as BalanceTransactionService,
)
from stripe._balance_transfer import BalanceTransfer as BalanceTransfer
from stripe._balance_transfer_service import (
BalanceTransferService as BalanceTransferService,
)
from stripe._bank_account import BankAccount as BankAccount
from stripe._base_address import BaseAddress as BaseAddress
from stripe._billing_portal_service import (
Expand Down Expand Up @@ -686,6 +690,8 @@ def add_beta_version(
"stripe._balance_transaction_service",
False,
),
"BalanceTransfer": ("stripe._balance_transfer", False),
"BalanceTransferService": ("stripe._balance_transfer_service", False),
"BankAccount": ("stripe._bank_account", False),
"BaseAddress": ("stripe._base_address", False),
"BillingPortalService": ("stripe._billing_portal_service", False),
Expand Down
14 changes: 13 additions & 1 deletion stripe/_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ class SupportAddress(StripeObject):
"""
Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes.
"""
specified_commercial_transactions_act_url: Optional[str]
"""
A link to the business's publicly available terms related to the Specified Commercial Transaction Act. Only used for accounts in Japan.
"""
support_address: Optional[SupportAddress]
"""
A publicly available mailing address for sending support issues to.
Expand Down Expand Up @@ -1414,7 +1418,7 @@ class Invoices(StripeObject):
Literal["always", "never", "offer"]
]
"""
Whether payment methods should be saved when a payment is completed for a one-time invoices on a hosted invoice page.
Whether to save the payment method after a payment is completed for a one-time invoice or a subscription invoice when the customer already has a default payment method on the hosted invoice page.
"""

class Payments(StripeObject):
Expand Down Expand Up @@ -1487,6 +1491,12 @@ class Schedule(StripeObject):
"""
_inner_class_types = {"schedule": Schedule}

class PaypayPayments(StripeObject):
goods_type: Optional[Literal["digital_content", "other"]]
"""
Whether your business sells digital content or not.
"""

class SepaDebitPayments(StripeObject):
creditor_id: Optional[str]
"""
Expand Down Expand Up @@ -1527,6 +1537,7 @@ class TosAcceptance(StripeObject):
invoices: Optional[Invoices]
payments: Payments
payouts: Optional[Payouts]
paypay_payments: Optional[PaypayPayments]
sepa_debit_payments: Optional[SepaDebitPayments]
tax_forms: Optional[TaxForms]
treasury: Optional[Treasury]
Expand All @@ -1541,6 +1552,7 @@ class TosAcceptance(StripeObject):
"invoices": Invoices,
"payments": Payments,
"payouts": Payouts,
"paypay_payments": PaypayPayments,
"sepa_debit_payments": SepaDebitPayments,
"tax_forms": TaxForms,
"treasury": Treasury,
Expand Down
2 changes: 1 addition & 1 deletion stripe/_api_requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def _args_for_request_with_retries(
**params,
}

encoded_params = urlencode(list(_api_encode(params or {}, api_mode)))
encoded_params = urlencode(list(_api_encode(params or {})))

# Don't use strict form encoding by changing the square bracket control
# characters back to their literals. This is fine by the server, and
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 = "2025-10-29.preview"
CURRENT = "2025-11-17.preview"
152 changes: 152 additions & 0 deletions stripe/_balance_transfer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._createable_api_resource import CreateableAPIResource
from stripe._expandable_field import ExpandableField
from stripe._stripe_object import StripeObject
from typing import ClassVar, Dict, Optional, cast
from typing_extensions import Literal, Unpack, TYPE_CHECKING

if TYPE_CHECKING:
from stripe._balance_transaction import BalanceTransaction
from stripe.params._balance_transfer_create_params import (
BalanceTransferCreateParams,
)


class BalanceTransfer(CreateableAPIResource["BalanceTransfer"]):
"""
Balance transfers represent funds moving between balance types on your Stripe account.
They currently support moving funds between your Stripe balance and your [Issuing](https://stripe.com/docs/issuing) balance and between your [Allocated Funds](https://stripe.com/docs/connect/funds-segregation) balance and your Stripe balance.
"""

OBJECT_NAME: ClassVar[Literal["balance_transfer"]] = "balance_transfer"

class DestinationBalance(StripeObject):
class Issuing(StripeObject):
balance_transaction: Optional[
ExpandableField["BalanceTransaction"]
]
"""
Identifier for the balance_transaction that increased the destination balance.
"""

class Payments(StripeObject):
balance_transaction: Optional[
ExpandableField["BalanceTransaction"]
]
"""
Identifier for the balance_transaction that increased the destination balance.
"""

issuing: Optional[Issuing]
payments: Optional[Payments]
type: str
"""
Destination balance type to adjust for the Balance Transfer. One of `payments`, `issuing`, or `allocated_funds`.
"""
_inner_class_types = {"issuing": Issuing, "payments": Payments}

class SourceBalance(StripeObject):
class Issuing(StripeObject):
balance_transaction: Optional[
ExpandableField["BalanceTransaction"]
]
"""
Identifier for the balance_transaction that decreased the source balance.
"""

class Payments(StripeObject):
balance_transaction: ExpandableField["BalanceTransaction"]
"""
Identifier for the balance_transaction that decreased the source balance.
"""
source_type: Optional[str]
"""
The payments balance type that this BalanceTransfer pulled funds from. One of `card`, `fpx`, or `bank_account`.
"""

issuing: Optional[Issuing]
payments: Optional[Payments]
type: str
"""
Source balance type to adjust for the Balance Transfer. One of `payments`, `issuing`, or `allocated_funds`.
"""
_inner_class_types = {"issuing": Issuing, "payments": Payments}

amount: int
"""
A positive integer representing how much was transferred in the smallest currency unit.
"""
created: int
"""
Time at which the object was created. Measured in seconds since the Unix epoch.
"""
currency: str
"""
Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
"""
destination_balance: Optional[DestinationBalance]
"""
The balance that funds were transferred to.
"""
hosted_regulatory_receipt_url: Optional[str]
"""
A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses.
"""
id: str
"""
Unique identifier for the object.
"""
livemode: bool
"""
Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
"""
metadata: Dict[str, str]
"""
Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
"""
object: Literal["balance_transfer"]
"""
String representing the object's type. Objects of the same type share the same value.
"""
source_balance: Optional[SourceBalance]
"""
The balance that funds were transferred from. One of `card`, `fpx`, or `bank_account`.
"""

@classmethod
def create(
cls, **params: Unpack["BalanceTransferCreateParams"]
) -> "BalanceTransfer":
"""
Creates a balance transfer. For Issuing use cases, funds will be debited immediately from the source balance and credited to the destination balance immediately (if your account is based in the US) or next-business-day (if your account is based in the EU). For Segregated Separate Charges and Transfers use cases, funds will be debited immediately from the source balance and credited immediately to the destination balance.
"""
return cast(
"BalanceTransfer",
cls._static_request(
"post",
cls.class_url(),
params=params,
),
)

@classmethod
async def create_async(
cls, **params: Unpack["BalanceTransferCreateParams"]
) -> "BalanceTransfer":
"""
Creates a balance transfer. For Issuing use cases, funds will be debited immediately from the source balance and credited to the destination balance immediately (if your account is based in the US) or next-business-day (if your account is based in the EU). For Segregated Separate Charges and Transfers use cases, funds will be debited immediately from the source balance and credited immediately to the destination balance.
"""
return cast(
"BalanceTransfer",
await cls._static_request_async(
"post",
cls.class_url(),
params=params,
),
)

_inner_class_types = {
"destination_balance": DestinationBalance,
"source_balance": SourceBalance,
}
52 changes: 52 additions & 0 deletions stripe/_balance_transfer_service.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# -*- coding: utf-8 -*-
# File generated from our OpenAPI spec
from stripe._stripe_service import StripeService
from typing import Optional, cast
from typing_extensions import TYPE_CHECKING

if TYPE_CHECKING:
from stripe._balance_transfer import BalanceTransfer
from stripe._request_options import RequestOptions
from stripe.params._balance_transfer_create_params import (
BalanceTransferCreateParams,
)


class BalanceTransferService(StripeService):
def create(
self,
params: "BalanceTransferCreateParams",
options: Optional["RequestOptions"] = None,
) -> "BalanceTransfer":
"""
Creates a balance transfer. For Issuing use cases, funds will be debited immediately from the source balance and credited to the destination balance immediately (if your account is based in the US) or next-business-day (if your account is based in the EU). For Segregated Separate Charges and Transfers use cases, funds will be debited immediately from the source balance and credited immediately to the destination balance.
"""
return cast(
"BalanceTransfer",
self._request(
"post",
"/v1/balance_transfers",
base_address="api",
params=params,
options=options,
),
)

async def create_async(
self,
params: "BalanceTransferCreateParams",
options: Optional["RequestOptions"] = None,
) -> "BalanceTransfer":
"""
Creates a balance transfer. For Issuing use cases, funds will be debited immediately from the source balance and credited to the destination balance immediately (if your account is based in the US) or next-business-day (if your account is based in the EU). For Segregated Separate Charges and Transfers use cases, funds will be debited immediately from the source balance and credited immediately to the destination balance.
"""
return cast(
"BalanceTransfer",
await self._request_async(
"post",
"/v1/balance_transfers",
base_address="api",
params=params,
options=options,
),
)
4 changes: 2 additions & 2 deletions stripe/_bank_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ class Error(StripeObject):
"""
status: str
"""
For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated.
For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, `tokenized_account_number_deactivated` or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If the status is `tokenized_account_number_deactivated`, the account utilizes a tokenized account number which has been deactivated due to expiration or revocation. This account will need to be reverified to continue using it for money movement. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated.

For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.
For external accounts, possible values are `new`, `errored`, `verification_failed`, and `tokenized_account_number_deactivated`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply.
"""

@classmethod
Expand Down
8 changes: 7 additions & 1 deletion stripe/_charge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1282,6 +1282,7 @@ class Ideal(StripeObject):
"asn_bank",
"bunq",
"buut",
"finom",
"handelsbanken",
"ing",
"knab",
Expand All @@ -1298,7 +1299,7 @@ class Ideal(StripeObject):
]
]
"""
The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `finom`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
"""
bic: Optional[
Literal[
Expand All @@ -1307,6 +1308,7 @@ class Ideal(StripeObject):
"BITSNL2A",
"BUNQNL2A",
"BUUTNL2A",
"FNOMNL22",
"FVLBNL22",
"HANDNL2A",
"INGBNL2A",
Expand Down Expand Up @@ -1337,6 +1339,10 @@ class Ideal(StripeObject):
"""
Last four characters of the IBAN.
"""
transaction_id: Optional[str]
"""
Unique transaction ID generated by iDEAL.
"""
verified_name: Optional[str]
"""
Owner's verified full name. Values are verified or provided by iDEAL directly
Expand Down
5 changes: 4 additions & 1 deletion stripe/_confirmation_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ class Ideal(StripeObject):
"asn_bank",
"bunq",
"buut",
"finom",
"handelsbanken",
"ing",
"knab",
Expand All @@ -985,7 +986,7 @@ class Ideal(StripeObject):
]
]
"""
The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `buut`, `finom`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.
"""
bic: Optional[
Literal[
Expand All @@ -994,6 +995,7 @@ class Ideal(StripeObject):
"BITSNL2A",
"BUNQNL2A",
"BUUTNL2A",
"FNOMNL22",
"FVLBNL22",
"HANDNL2A",
"INGBNL2A",
Expand Down Expand Up @@ -1435,6 +1437,7 @@ class Blocked(StripeObject):
"bank_account_restricted",
"bank_account_unusable",
"debit_not_authorized",
"tokenized_account_number_deactivated",
]
]
"""
Expand Down
Loading
Loading