#jayforbesiii_checkout-session-metadata
1 messages ยท Page 1 of 1 (latest)
๐ 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.
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?
An example Session ID is cs_test_a17s5KgAft0U3ZKgeYwMMUjrrYJHlwaWNQxUBEohRlLl9iXQAORINsQOBX
I'm using the sessions API
Thanks, taking a look at the Checkout Session
There is no metadata associated with this Checkout Session
Ah, okay. Looking at the creation request: https://dashboard.stripe.com/test/logs/req_Zyznne8ZMhdOQ1
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
Should I be storing it with the checkout session? Is that possible?
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.
ok
But, if you want to get the metadata from the Checkout Session, then you can set directly on the Checkout Session: https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-metadata
You could even do both
It just depends on what would make the most sense for your integration
thanks. I'll refactor this and see if that does it
Great, happy to shed what ๐ก I can ๐