#atul
1 messages · Page 1 of 1 (latest)
Hi there!
The invoice.paid event contains a invoice object.
If there are metadata on the invoice object, you should see it in the payload directly.
And if you want to add metadata to the invoice, you can update the invoice and pass the metadata property https://stripe.com/docs/api/invoices/update#update_invoice-metadata
I am using stripe checkout API
And i want metadata in successive invoice.paid event
which will be triggered in upcoming billing cycle
which metadata do you want? the metadata from the checkout session?
yes exactly
One way to do this would be to:
- listen to the
invoice.createdevent - in the invoice object, find the subscription ID: https://stripe.com/docs/api/invoices/object#invoice_object-subscription
- use the subscription ID to find the corresponding Checkout Session with https://stripe.com/docs/api/checkout/sessions/list
- then update the
metadataof invoice object with the Checkout Sessionmetadata