#SciAndy
1 messages · Page 1 of 1 (latest)
hello! where are you passing in that metadata :
- https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata, or
- https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-subscription_data-metadata
If you pass the metadata into subscription_data.metadata - the Subscription will contain that metadata, and so will the Invoice Line Items : https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-metadata
Oh wow thanks, I didnt even know about the second one. I am doing the first one, I will change it to the subscription_data one.
So like
stripe.checkout.Session.create(
success_url="https://example.com/success",
line_items=[
{
"price": "price_H5ggYwtDq4fbrJ",
"quantity": 2,
},
],
subscription_data.metadata = {"user_id": "useridhere"}
mode="payment",
)```
Does that look right?
there's no harm in putting it in both places really. You can try running your code and checking the resulting Subscription object after payment is completed
also, mode should be subscription, not payment
thanks, gonna try it now with
"metadata": {"user_id": user_id},
},``` hopefully that is right, what I gave earlier is not