#RogueOne

1 messages · Page 1 of 1 (latest)

ionic chasmBOT
sleek juniper
#

Save what ID? What are you trying to do that you can't do?

shadow zealot
#

i want to save certain data in my db about purchase when the checkout is success

#

i tried with metada, but when checkout is success it is null

sleek juniper
#

What metadata, where are you looking specifically? Can you share example checkout session IDs or event ID that you're looking at where you expect to find metadata?

shadow zealot
#

i need save planid and userid

sleek juniper
#

Hey sorry for the delay, i missed your message here

#

Ah, so the metadata is within the line items then

#

Ok, then to retrieve this you need to expand the line_items when retrieving the Checkout session:
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
https://stripe.com/docs/expand

Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.