#kado-aelan-metadata
1 messages · Page 1 of 1 (latest)
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.
hmm okay so is there a way to make that metadata object persist throughout subscription, invoice, and customer webhook events?
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
ahhh gotcha ! okay thank you friend
Sure thing!
how would i update invoice object from the checkout.session.completed webhook ? is it possible
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.
gotcha and then from the invoice webhooks i can just get the subscription id and get teh metadata from that
Yeah