#kado-aelan-metadata

1 messages · Page 1 of 1 (latest)

fleet obsidian
#

Hi there! How are you setting the metadata? On Checkout Session creation?

main cloak
fleet obsidian
#

And what webhook event are you ingesting?

#

The metadata will show up on checkout.session.completed

#

If you are looking at payment_intent.succeeded for instance, then the metadata won't show up there as it is being set on the Checkout Session object.

main cloak
#

hmm okay so is there a way to make that metadata object persist throughout subscription, invoice, and customer webhook events?

fleet obsidian
#

No, you would need to update those objects after they are created.

#

So you would listen for checkout.session.completed and then update the metadata on any of the relevant objects you want to update

main cloak
#

ahhh gotcha ! okay thank you friend

fleet obsidian
#

Sure thing!

main cloak
#

how would i update invoice object from the checkout.session.completed webhook ? is it possible

fleet obsidian
#

You would retrieve the subscription and look at the subscription.latest_invoice, or you would listen for invoice.paid instead of checkout.session.completed. You should beware that updating metadata on the first invoice won't update it on all future invoices. You would need to update each invoice after it is created. I'd recommend just setting metadata on the Subscription if this is going to be the case.

main cloak
#

gotcha and then from the invoice webhooks i can just get the subscription id and get teh metadata from that

fleet obsidian
#

Yeah