#jayforbesiii_checkout-session-metadata

1 messages ยท Page 1 of 1 (latest)

glass sluiceBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1325870446159069245

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

dusk panther
#

Hi ๐Ÿ‘‹

Can you share the ID of a checkout session where you have set metadata? It will look like cs_test_XXXXX or cs_live_XXXX (depending on whether it's in Test mode or Live mode).

Can you also share what API you are using to retrieve the info?

white wraith
#

An example Session ID is cs_test_a17s5KgAft0U3ZKgeYwMMUjrrYJHlwaWNQxUBEohRlLl9iXQAORINsQOBX

#

I'm using the sessions API

dusk panther
#

Thanks, taking a look at the Checkout Session

#

There is no metadata associated with this Checkout Session

#

You set the metadata in the payment_intent_data.metadata so the metadata provided only exists on the related Payment Intent

#

pi_3QeJiYRxdsQFWYoC0rQYWpGt

#

You can use the Payment Intent API to retrieve this information

white wraith
#

Should I be storing it with the checkout session? Is that possible?

dusk panther
#

If that is where you want to access the metadata, then you would store it there.

#

It's up to you. Most of our users want to access the metadata when they receive the payment_intent.succeeded webhook so we recommend they set it on the Payment Intent like you did.

white wraith
#

ok

dusk panther
#

You could even do both

#

It just depends on what would make the most sense for your integration

white wraith
#

thanks. I'll refactor this and see if that does it

dusk panther
#

Great, happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚