#AlphaRyze

1 messages ยท Page 1 of 1 (latest)

barren oliveBOT
fresh igloo
#

๐Ÿ‘‹ Hello! Are you trying to set the metadata of the PaymentLink or the underlying Subscription that will be created?

proud vigil
#

since i want to redirect with a button

#

from my website to the stripe payment subscription

#

and logging with an endpoint the events

#

i wanted to add in the metadata before the redirect to stripe occurs the userId from my website that is trying to pay

fresh igloo
#

So there's no way to add metadata like that, but you can use client_reference_id for the same purpose

proud vigil
#

hmm how?

#

cause i checked the docs and i didn't find anything

fresh igloo
#

Yeah I'm not sure why it moved from the docs, but it should still work - try it out in test mode

proud vigil
#

i'm already in test mode

#

and currently i'm on the product page ( the one which requires subscription )

#

i tried adding the metadata field called userId and interact with it via the URL params but it didn't quite work

#

so how could i use the client_reference_id?

fresh igloo
#

If you have a URL like this : https://buy.stripe.com/test_sacacacacsasca?client_reference_id=1234 then you should see client_reference_id: 1234 set on the compelted Checkout Session (see https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-client_reference_id)

proud vigil
#

many thanks

#

i'll try it out rn

#

it works thanks , now you may close the thread

fresh igloo
#

๐Ÿ‘