#resolveai
1 messages · Page 1 of 1 (latest)
Hey there, sorry for the delay
Where are you setting metadata currently?
You control when and where metadata is stored in most cases
session = stripe.checkout.Session.create(
metadata= {"user_id": user_id}
)
like this
of course theres more in the session create
Sure, gotcha
So this is attached to the Checkout session
The way you could port this to a customer would be in a webhook handler for checkout.session.completed events
yes
i know what do i do to add it to customer?
You'd inspect the session metadata and the customer ID, then update the customer object to apply any metadata to the customer that you want there
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
stripe.Customer.modify(
"cus_ICdmArUkdrMi1a",
metadata={"order_id": "6735"},
)
thanks a lot man