#thekents

1 messages ยท Page 1 of 1 (latest)

pallid foxBOT
red sigil
#

๐Ÿ‘‹ happy to help

#

yes you can update the metadata of a checkout session after being completed

#

oh sorry my bad!

#

I was thinking of PaymentIntents there ๐Ÿ˜ฆ my bad

#

you can't update the Checkout Session's metadata but rather the underlying PaymentIntent's metadata

queen aspen
#

Hmm, okay

#

Need to think a little then

#

Thanks for your help

red sigil
#

if you tell me what's your use case I might be able to help you figure out the best integration path for your use case

queen aspen
#

oh sorry, didn't notice your message

#

well I want it to make so that when checkout session is completed, webhook generates a promotion code for their next purchase

red sigil
#

and why do you need to update the Checkout Session metadata?

queen aspen
#

I would like to know which promotion code was created from which checkout session

#

Each user would have their own specific code

red sigil
#

you can do the opposite in this case, and add the checkout session ID as a metadata to the coupon

queen aspen
#

That wont show up under Checkout details right?

#

Only when i go find checkout id under coupon codes right

#

I would like to have them all in one place

#

Im thinking of generating that code and then adding it as an extra to an order to Firebase database, I anyway have to update product amount after purchase

red sigil
#

you can create the coupon when creating the checkout

#

and only making it available on the checkout.session.completed event

queen aspen
red sigil
red sigil
queen aspen
#

But yes, your option works too

#

But perhaps i will still go with the firebase database since I have admin panel anyways

#

So order list would be a nice extra to that ๐Ÿ™‚

red sigil
#

it's really up to you to decide which approach to choose

queen aspen
#

Yea, thank you still for helping

red sigil
#

let me know if you need any more help