#DaxSnax
1 messages · Page 1 of 1 (latest)
Hi there
Sure thing
So line_items are not returned with a Checkout Session by default, instead when you receive the checkout.session.completed webhook, you want to retrieve the Checkout Session in that webhook and expand line_items: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
ok i will give that a bash, will a checkout.session.completed be sent montly with subscriptions or will that only fire the first time when the subscription is setup?
Only when it is set up
You either want to use customer.subscription.updated or invoice.paid for renewals
so i would most likely then need to skip the checkout.session.completed for subscriptions and have two webhooks
Yeah up to you really
You can either use both, or just use customer.subscription.updated
so i would like the monthly call to the webhook so i know to update the users subscription and credit them with the number of units they are subscribed to
idealy my goal is to not have to have a scheduled task to check their subscription every month and just rely on the webhooks firing
Yes sorry, you definitely want to use webhooks
The question is just whether you want to just queue off of the data in one webhook event, or you can use two different events — one for when the Sub begins (checkout.session.completed) and one for when the renewal occurs.
That part is just at your discretion
sure, i guess so. Seems to me i am forced to use two webhooks because the once off does not fire an invoice.paid
thanks for the advice will try see if i can get this working
Yep so you will need both to handle subs/one-time payments