#velix - checkout
1 messages ยท Page 1 of 1 (latest)
Yea you can do API retrieval after receiving webhooks, sure!
Also note that the session object itself includes some information about applies discounts:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-total_details-breakdown-discounts
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Sorry for the delay while responding. The typing in Discord is heavily lagged on my computer.
So you might be able to get the information you need there in the checkout.session.completed event
Not a problem at all
Will I receive "checkout.session.completed" always immediately or also asynchron?
I've switched the computer. Typing working now. I've just checked the checkout.session.completed webhooks, I've received. It doesn't contain the discount name, etc. ๐ฆ
It will be sent to you before redirecting your customer. It is async, but very fast.
So I guess it's best to wait for checkout.session.completed and then grab all details from the API.
payment can be asynchron, of course.
Interesting, total_details.breakdown is not in the checkout.session.completed webhook response.
Ah that's true .it's marked as Expandable -- apologies I missed that
Yeah ๐
So yes to get thoe details you'd need to retrieve the session form the API and use expansion to include that in the response
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Okay, I'll read into this. Thanks!
expand[]=total_details.breakdown
Can I also get the discount.name this way?
Ah yeah, I can receive the discount object. Nice.
Thanks for your time!
@frosty merlin Yes we have rate limits, and you can find more info here:
Thanks a lot. I need to tkae care of this ๐
When asking for the expanded object.
No problem! Yep, good to be aware of ๐
Thanks a gain!
NP!