-
Notifications
You must be signed in to change notification settings - Fork 458
Migration guide for v13
The v13 of the Python SDK uses the API version 2025-09-30.clover
. If the format of this API version looks new to you, see our new API release process
The new API version comes with a quite a few breaking changes, most notably:
- V1 namespaces: We've introduced v1 namespaces to StripeClient to follow the new paradigm followed after the introduction of v2 namespaces. More details and migration instructions are available in our v1 namespace wiki page.
- Params changes: We've combined parameter types for resource and service types. More details are available below.
- V2 Events: We've overhauled how V2 Events are handled in the SDK, and moved them under
stripe.v2.core
to mirror the API. This approach should provide a lot more information at authoring and compile time, leading to more robust integrations. As part of this process, there are a number of changes to be aware of. The changelog has explicit details of breaking changes, and an example for how to use our new events pattern is available. - Drop support for Python 3.6: We have published a new language support policy and dropped support for Python 3.6. A schedule for future deprecations has also been provided.
Please review our API changelog for 2025-09-30.clover to understand all the breaking changes to the Stripe API, the reasons behind them and potential alternatives.
The Python SDK specific changelog for v13 will have the corresponding changes in the SDKs as well as SDK specific breaking changes.
Resource and service parameters have been unified to increase consistency and decrease package size in this major.
Parameters in resources and services have been moved to the stripe.params
package, prefixed with the relevant resource/service and method name.
For example, stripe.CustomerService.CreateParams
is now stripe.params.CustomerCreateParams
. Namespaced parameters can be found in their respective namespace, such as stripe.params.checkout.SessionCreateParams
.
There are no changes necessary if you do not reference parameter types directly when making requests, like so:
from stripe import StripeClient
client = StripeClient(API_KEY)
client.v1.customers.create({
name="Foo",
email="[email protected]"
})
If you use parameter types directly, you will need to update your imports. For example:
## Before
from stripe import StripeClient
from stripe import CustomerService
client = StripeClient(API_KEY)
params: CustomerService.CreateParams = {
"name": "Foo",
"email": "[email protected]"
}
client.v1.customers.create(params)
## After
from stripe import StripeClient
from stripe.params import CustomerCreateParams
client = StripeClient(API_KEY)
params: CustomerCreateParams = {
"name": "Foo",
"email": "[email protected]"
}
client.v1.customers.create(params)