KEMBAR78
13.0.0: Lost types `stripe.checkout.Session.CreateParamsLineItem` and `stripe.checkout.Session.CreateParamsDiscount` · Issue #1625 · stripe/stripe-python · GitHub
Skip to content

13.0.0: Lost types stripe.checkout.Session.CreateParamsLineItem and stripe.checkout.Session.CreateParamsDiscount #1625

@kennyhei

Description

@kennyhei

Describe the bug

In my code, when creating new checkout session (stripe.checkout.Session.create(...)), I have typed the line_items like this:

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

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions