#velix - checkout

1 messages ยท Page 1 of 1 (latest)

upbeat falcon
#

Yea you can do API retrieval after receiving webhooks, sure!

frosty merlin
#

Sorry for the delay while responding. The typing in Discord is heavily lagged on my computer.

upbeat falcon
#

So you might be able to get the information you need there in the checkout.session.completed event

#

Not a problem at all

frosty merlin
#

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. ๐Ÿ˜ฆ

upbeat falcon
#

It will be sent to you before redirecting your customer. It is async, but very fast.

frosty merlin
#

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.

upbeat falcon
#

Ah that's true .it's marked as Expandable -- apologies I missed that

frosty merlin
#

Yeah ๐Ÿ™‚

upbeat falcon
#

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

frosty merlin
#

Okay, I'll read into this. Thanks!

upbeat falcon
#

expand[]=total_details.breakdown

frosty merlin
#

Can I also get the discount.name this way?

#

Ah yeah, I can receive the discount object. Nice.

#

Thanks for your time!

upbeat falcon
#

NP!

#

Glad that helped!

upbeat falcon
#

@frosty merlin Yes we have rate limits, and you can find more info here:

frosty merlin
#

Thanks a lot. I need to tkae care of this ๐Ÿ˜„

#

When asking for the expanded object.

upbeat falcon
#

No problem! Yep, good to be aware of ๐Ÿ™‚

frosty merlin
#

Thanks a gain!

upbeat falcon
#

NP!