#nekaoumike
1 messages ยท Page 1 of 1 (latest)
You can call Retrieve Checkout Session API, expanding lines_item.data.price.product
const session = await stripe.checkout.sessions.retrieve(msg.session_id)
This is the code I am using to fetch checkout
when I console log it I don't see line items
this is in test mode as of now
only thing would be if subscriptions are treated differently
You want to expand
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh-
Not quite (just jumping in; I don't work for stripe)
stripe.customers.retrieve('cu_1J8cpqHBt5A08RV1DphWiRZL', {
expand: ['customer', 'invoice.subscription'],
});
ofc I would change it to be for line items
StripeInvalidRequestError: This property cannot be expanded (lines_item).
ah
found the right one
Thank you for visiting Stripe discord. That'll be $5.
it's line_items
๐
๐
Jokes. I don't work here
LOL
Also, try inputting what @bronze nimbus said earlier: "lines_item.data.price.product". That's probably most accurate
You mean $9.99 ๐
yup mods are not wanting off topic stuff-
session.lines_item.data.description seems to be it
I take that back
session.line_items.data[0].description it's an array
๐ LMK if you have issues
not a issue but a different question so I'll make a thread for it
You can just continue here
ah ok. then in that case it's in regards to subscriptions. I want to have my app and stripe be in sync. So that if they auto renew on stripe my app can pick it up too. I am storing the subscription ID if that helped me
When a Subscription renews itself, it will send you webhook events
um
and how would I make sure my app captures said webhook events?
invoice.created
You can check if that Invoice is belongs to a Subscription, when you retrieve the webhook event
do you happen to have a node JS sample code to capture a webhook event?
https://stripe.com/docs/webhooks/quickstart?lang=node here for the example!
Ah I see now
What type of request does it send btw?
Awesome