#caroline0
1 messages · Page 1 of 1 (latest)
to be more specific it looks like the Stripe.Subscription type doesn't include a product ID
Hi, how are you integrated with Stripe? Are you using Payment Element, Srtipe Checkout or something else in your Subscription Integration?
we're using stripe checkout
I see, in this case you can set your own Ids in the Metadata of both prices , https://stripe.com/docs/api/prices/create#create_price-metadataand products, https://stripe.com/docs/api/products/create#create_product-metadata. After completing the Checkout Session and when receiving the Webhook, https://stripe.com/docs/api/events/types#event_types-checkout.session.completed you’ll get the Prices with its metadata that contains your database related Ids, as you have access to the session's purchased items.
Metadata is a key-value pair that you can pass on Stripe objects, https://stripe.com/docs/api/metadata add in more details on the object.
also – will this solution make this metadata available to subscription webhook events? or only checkout?
because I need it in the subscription event
I see, I went too quickly. You can set the Metadata on the Subscription as well when creating the Checkout Session: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata.
oh great thank you! I'll give this a try