#Slanfan-Checkout-Metadata
1 messages · Page 1 of 1 (latest)
We don't have such a deep parameter. You can have metadata on the Subscription itself, then by listening to webhook event each time a PaymentIntent is created, find the Subscription metadata and update it in the PaymentIntent metadata
Thats fine but where do I add the metadata so that it ends up in the customer.subscription.created object?
stripe.checkout.sessions.create({ customer: customerId, payment_method_types: ['card'], line_items: data.line_items, mode: 'subscription', success_url: 'url', cancel_url: 'url', metadata: data.metadata, })
This is how I create the checkout
{ price_data: { currency, product_data: { name: productName, metadata: metadata, }, unit_amount: unit_amount * PaymentFactor, recurring: { interval: 'day', interval_count: 1, } }, quantity: 1, }
this is the line item
That will be added to the Checkout Session metadata
You would want subscription_data.metadata instead: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks!