#surbhi
1 messages · Page 1 of 1 (latest)
If you scroll down a bit in the right pane, is the metadata in that hash that is getting cut off in that screenshot?
There are two places you can set metadata on a Checkout Session, one that sets it on the checkout session itself and one that sets it on the object that you are creating with the session
In that specific hash? Or just in general?
in that specific hash2
Are you in subscription mode or payment mode here?
payment ..
Are you creating a subscription or a one time payment?
one time payment
Gotcha. Unfortunately I don't think the metadata from that can show up on the invoice metadata. Just the Checkout Session metadata or the payment intent's metadata if you set it through the payment_intent_data hash https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So to get it on the invoice you will need to manually set it by updating the invoice
as u see i have already set the metadata during chekcout session but when i check my webhoook its not there
Can you send me the ID of that checkout Session (cs_test_123 or cs_live_123)?
And did you check the other metadata hashes on that event? It looks like that might be the one that is specifically on the payment intent
cs_live_a1FJXCGKaxVH0rrxphl1LZjCHHscBBB8cATDjw2t2OL1TeaZyVxvI0hhHj
OrderID: "2552245"
},``` is set on the event itself
Try using ctrl+f and searching for "2552245", it is on that object, just in a different place
Right, that event is for the payment intent, not the checkout session. If you look at the events for the checkout session you will see the metadata https://dashboard.stripe.com/events/evt_1Mo5tK4RReTVKRHy2gHwTdfO
This is what I was getting at with this link https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata
You will need to set the metadata in that argument to set it on the payment intent so that it shows up in the payment_intent.succeeded event
u mean to say, in order to get metadata in webhook i need to set metadata in a different way
Basically, these are two separate (but related) objects. We don't automatically copy data between them so you need to explicitly set it like that.
Correct, for that specific webhook you need to set it on the payment intent, which you can do with that property that I linked to
ok.. i will try that..thank u