#Kirk-sub-metadata
1 messages · Page 1 of 1 (latest)
Hi there! To clarify, you are setting metadata on the Session itself via: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata, correct?
Correct
Gotcha. In that case, you want to change where you are setting metadata to use the subcription_data.metadata property: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata
This will carry the metadata that you set down to the Subscription object itself.
And you can then grab it consistently for renewals by retrieving the Subscription object (or using the customer.subscription.updated webhook)
You beautiful son of a gun. That looks like exactly what I needed. thanks!
❤️
Is there an easy way to go from PaymentIntent object -> Subscription object?
Yep. You expand the invoice (https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice) which will contain the subscription (https://stripe.com/docs/api/invoices/object#invoice_object-subscription) and you can expand the Subscription as well.