#boliboy
1 messages · Page 1 of 1 (latest)
Hi, if your previous previous thread is still open, you can just type any additional questions on there. Are you using a Checkout subscriptions? Or something else?
im using Prebuilt subscription page with Stripe Checkout
I based my code on this sample https://stripe.com/docs/billing/quickstart?lang=python
You can retrieve the Checkout Session, https://stripe.com/docs/api/checkout/sessions/retrieve and expand the line_items of the CheckoutSession : https://stripe.com/docs/expand#includable-properties. The line_items properties should have what you need: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price
I have names like Basic, Premium or so . So I want that retrieve that name. I thought i could get it from subscription api call in description but is returning null
which field in line_items is suppose to have that?
If you're retrieving the Subscription, https://stripe.com/docs/api/subscriptions/retrieve you'll need to expand the expand: ['data.items.data']
After testing this on my, the above would only show product_id but it would not expose the product name. For this reason, you'd need to either add a metadata on the Subscription or make another API request to retrieve the product to get the product name.