⚡ Solution Summary

  • Upgrade stripe-python to version 13.0.1
  • Types for line items and discounts are restored
  • Ensure compatibility with your existing code.
### Describe the bug In my code, when creating new checkout session (`stripe.checkout.Session.create(...)`), I have typed the `line_items` like this: ```python line_items: list[stripe.checkout.Session.CreateParamsLineItem] = [] ... stripe.checkout.Session.create( line_items=line_items, ... ) ``` I build the content of `line_items` using some helper functions and those functions have been typed to return `stripe.checkout.Session.CreateParamsLineItem` as well. Now in v13.0.0 this type does not exist anymore. The replacement for it is located in `stripe.params.checkout._session_create_params.SessionCreateParamsLineItem` but seems like that cannot be imported. Same issue for ```python discounts: list[stripe.checkout.Session.CreateParamsDiscount] = [] ``` This has been replaced by `stripe.params.checkout._session_create_params.SessionCreateParamsDiscount`, also not importable. What to do? ### To Reproduce 1. When creating checkout session with `stripe.checkout.Session.create(...)`, pass it `line_items` as a variable that has been declared as `line_items: list[stripe.checkout.Session.CreateParamsLineItem] = []` 2. Code does not work in v13.0.0, stating `AttributeError: type object 'Session' has no attribute 'CreateParamsLineItem'` 3. Same issue for `discounts` param if you pass it as a variable that has been declared as `discounts: list[stripe.checkout.Session.CreateParamsDiscount] = []` ### Expected behavior There should be a way to type both `discounts` and `line_items` params in the new major version. ### Code snippets ```Python ``` ### OS macOs ### Language version Python 3.13.1 ### Library version stripe-python v13.0.0 ### API version 2025-09-30.clover ### Additional context _No response_

Discussion & Fixes

xavdid-stripe 2025-10-03
This is fixed in 13.0.1. Thanks for flagging!

Get updates

We publish verified fixes weekly. No spam.

Subscribe