#TrickyMick
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
you can use the https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I'm already passing a price_id.. can I also pass price_data
const session = await stripe.checkout.sessions.create({
mode: 'subscription',
line_items: [
{
price: price_id,
// For metered billing, do not pass quantity
quantity: 1,
price_data: {here???}
},
],
can't you map your price_id to the service?
I mean you can add a metadata to the price itself
I suppose I can associate the price_id to my 'plan' in the DB.. and then just look it up when I get the price back
so you don't have to do it for each subscription
oh, I can add metadata to the price information in stripe?
to add metadata to an existing price https://stripe.com/docs/api/prices/update#update_price-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.
or you can add the metadata upon creation https://stripe.com/docs/api/prices/create#create_price-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.